1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-09 10:22:51 +03:00

Started more formal permission test case definitions

This commit is contained in:
Dan Brown
2022-12-15 11:22:53 +00:00
parent e8a8fedfd6
commit d54ea1b3ed
3 changed files with 90 additions and 1 deletions

View File

@@ -107,7 +107,7 @@ class PermissionApplicator
$allowedByTypeById = ['fallback' => [], 'user' => [], 'role' => []];
/** @var EntityPermission $permission */
foreach ($relevantPermissions as $permission) {
$allowedByTypeById[$permission->getAssignedType()][$permission->getAssignedTypeId()] = $permission->$permission;
$allowedByTypeById[$permission->getAssignedType()][$permission->getAssignedTypeId()] = boolval($permission->$action);
}
$inheriting = !isset($allowedByTypeById['fallback'][0]);