forked from mirror/Part-DB.Part-DB-server
Added permission to control if a user is allowed to withdraw/add/move parts
This commit is contained in:
parent
89a4846259
commit
60d5776cb7
7 changed files with 55 additions and 5 deletions
|
@ -77,6 +77,11 @@ class PermissionManager
|
|||
*/
|
||||
public function dontInherit(HasPermissionsInterface $user, string $permission, string $operation): ?bool
|
||||
{
|
||||
//Check that the permission/operation combination is valid
|
||||
if (! $this->isValidOperation($permission, $operation)) {
|
||||
throw new InvalidArgumentException('The permission/operation combination "'.$permission.'/'.$operation.'" is not valid!');
|
||||
}
|
||||
|
||||
//Get the permissions from the user
|
||||
return $user->getPermissions()->getPermissionValue($permission, $operation);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue