Use the new VoterHelper in voters

This commit is contained in:
Jan Böhmer 2023-08-28 22:00:25 +02:00
parent fc6643bd6f
commit 6be55d1837
16 changed files with 146 additions and 162 deletions

View file

@ -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) {