mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-01 07:49:33 +00:00
Use the new VoterHelper in voters
This commit is contained in:
parent
fc6643bd6f
commit
6be55d1837
16 changed files with 146 additions and 162 deletions
|
|
@ -32,7 +32,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter;
|
|||
* 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 Voter
|
||||
final class PermissionVoter extends Voter
|
||||
{
|
||||
public function __construct(private readonly VoterHelper $helper)
|
||||
{
|
||||
|
|
@ -62,7 +62,7 @@ class PermissionVoter extends Voter
|
|||
$attribute = ltrim($attribute, '@');
|
||||
[$perm, $op] = explode('.', $attribute);
|
||||
|
||||
$valid = $this->resolver->isValidOperation($perm, $op);
|
||||
$valid = $this->helper->isValidOperation($perm, $op);
|
||||
|
||||
//if an invalid operation is encountered, throw an exception so the developer knows it
|
||||
if(!$valid) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue