Skip to content

Commit 0aed5c1

Browse files
authored
fix: hasPermissions method should respect role permissions (#354)
1 parent c035f01 commit 0aed5c1

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Service/Permission/UserPermissionService.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ public function hasPermission(User $user, string $permission): bool
3535
if ($user->isAdmin()) {
3636
return true;
3737
}
38-
$permissions = $user->getPermissions();
39-
if (in_array($permission, $permissions)) {
40-
return true;
41-
}
4238

43-
return false;
39+
return $user->isAllowed($permission);
4440
}
4541
}

0 commit comments

Comments
 (0)