mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-23 19:39:31 +00:00
[EventLog] Added permission checking and link in tools tree.
This commit is contained in:
parent
8b1eccc48d
commit
b0dacbf570
4 changed files with 82 additions and 2 deletions
|
|
@ -28,6 +28,7 @@ use App\Entity\UserSystem\User;
|
|||
|
||||
/**
|
||||
* This voter allows you to directly check permissions from the permission structure, without passing an object.
|
||||
* This use the syntax like "@permission.op"
|
||||
* However you should use the "normal" object based voters if possible, because they are needed for a future ACL system.
|
||||
*/
|
||||
class PermissionVoter extends ExtendedVoter
|
||||
|
|
@ -44,7 +45,7 @@ class PermissionVoter extends ExtendedVoter
|
|||
$attribute = ltrim($attribute, '@');
|
||||
[$perm, $op] = explode('.', $attribute);
|
||||
|
||||
return $this->resolver->inherit($user, $perm, $op);
|
||||
return $this->resolver->inherit($user, $perm, $op) ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue