mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-05 17:59:33 +00:00
Allow to cache support status of voters
This should increase the performance a bit
This commit is contained in:
parent
879b702fc1
commit
7b6ba37667
14 changed files with 133 additions and 2 deletions
|
|
@ -47,6 +47,12 @@ final class PermissionVoter extends Voter
|
|||
return $this->helper->isGranted($token, $perm, $op);
|
||||
}
|
||||
|
||||
public function supportsAttribute(string $attribute): bool
|
||||
{
|
||||
//Check if the attribute has the form '@permission.operation'
|
||||
return preg_match('#^@\\w+\\.\\w+$#', $attribute) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the attribute and subject are supported by this voter.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue