[EventLog] Added permission checking and link in tools tree.

This commit is contained in:
Jan Böhmer 2020-01-25 23:17:06 +01:00
parent 8b1eccc48d
commit b0dacbf570
4 changed files with 82 additions and 2 deletions

View file

@ -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;
}
/**