Fixed error when trying to create a new role.

This commit is contained in:
flash 2023-12-02 02:57:46 +00:00
parent 432615508d
commit 2b34bde413

View file

@ -11,6 +11,7 @@ $viewerPerms = $authInfo->getPerms('user');
if(!$viewerPerms->check(Perm::U_ROLES_MANAGE))
Template::throwError(403);
$roleInfo = null;
$usersCtx = $msz->getUsersContext();
$users = $usersCtx->getUsers();
$roles = $usersCtx->getRoles();
@ -30,7 +31,7 @@ if(filter_has_var(INPUT_GET, 'r')) {
$currentUser = $authInfo->getUserInfo();
$canEditPerms = $viewerPerms->check(Perm::U_PERMS_MANAGE);
$permsInfos = $perms->getPermissionInfo(roleInfo: $roleInfo, categoryNames: Perm::INFO_FOR_ROLE);
$permsInfos = $roleInfo === null ? null : $perms->getPermissionInfo(roleInfo: $roleInfo, categoryNames: Perm::INFO_FOR_ROLE);
$permsLists = Perm::createList(Perm::LISTS_FOR_ROLE);
while($_SERVER['REQUEST_METHOD'] === 'POST' && CSRF::validateRequest()) {