Skip to content

Commit

Permalink
Fix array_key_exists error when creating a new user
Browse files Browse the repository at this point in the history
  • Loading branch information
filliph committed Jul 25, 2020
1 parent 692efd7 commit 6e6307d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions XF/PermissionSet.php
Expand Up @@ -25,6 +25,11 @@ public function hasGlobalPermission($group, $permission)
$permissionCombinationId = $this->getPermissionCombinationId();
$permissions = $permissionCache->getGlobalPerms($permissionCombinationId);

if (!$permissions)
{
return false;
}

$groupEscaped = \XF::escapeString($group);
$permissionEscaped = \XF::escapeString($permission);

Expand All @@ -37,11 +42,6 @@ public function hasGlobalPermission($group, $permission)
$this->logPermissionError("Permission '$permissionEscaped' is unknown in '$groupEscaped' permission group");
}

if (!$permissions || !isset($permissions[$group][$permission]))
{
return false;
}

return $permissions[$group][$permission];
}

Expand Down

0 comments on commit 6e6307d

Please sign in to comment.