improve permission checks for timesheets with activated lockdown (#2271)

This commit is contained in:
Kevin Papst
2021-01-17 17:50:37 +01:00
committed by GitHub
parent 8d72d114c7
commit 67d5cba09f
24 changed files with 595 additions and 111 deletions

View File

@@ -90,6 +90,17 @@ final class RolePermissionManager
return \in_array($permission, $this->permissions[$role]);
}
public function hasRolePermission(User $user, string $permission)
{
foreach ($user->getRoles() as $role) {
if ($this->hasPermission($role, $permission)) {
return true;
}
}
return false;
}
/**
* Only permissions which were registered through the Symfony configuration stack will be returned here.
*