mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-14 04:14:36 +02:00
Added some unit tests.
This commit is contained in:
parent
1c7155d4e7
commit
943d235b8b
9 changed files with 562 additions and 40 deletions
|
@ -179,8 +179,12 @@ class PermissionResolver
|
|||
*/
|
||||
public function listOperationsForPermission(string $permission): array
|
||||
{
|
||||
if(!$this->isValidPermission($permission)) {
|
||||
throw new \InvalidArgumentException(sprintf('A permission with that name is not existing! Got %s.', $permission));
|
||||
}
|
||||
$operations = $this->permission_structure['perms'][$permission]['operations'];
|
||||
|
||||
|
||||
return array_keys($operations);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue