Added permission to control if a user is allowed to withdraw/add/move parts

This commit is contained in:
Jan Böhmer 2023-01-07 21:23:36 +01:00
parent 89a4846259
commit 60d5776cb7
7 changed files with 55 additions and 5 deletions

View file

@ -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);
}