Skip to content

Commit 62dfe7f

Browse files
committed
Use groupHasPermission
1 parent a9ccdcc commit 62dfe7f

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

core/classes/Permissions/PermissionCalculator.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,9 @@ public function userHasPermission(User $user, string $permission): bool
3232

3333
if ($result === PermissionTristate::INHERIT) {
3434
foreach ($user->getGroups() as $group) {
35-
$group_permissions = $this->_permission_cache->getOrLoad(Group::class, $group->id);
36-
37-
$result = $group_permissions[$permission] ?? PermissionTristate::INHERIT;
38-
39-
if ($result === PermissionTristate::TRUE) {
35+
if ($this->groupHasPermission($group, $permission)) {
4036
return true;
4137
}
42-
43-
if ($result === PermissionTristate::FALSE) {
44-
return false;
45-
}
4638
}
4739
}
4840

0 commit comments

Comments
 (0)