refactoring of RequestSecurityEventSubscriber

This commit is contained in:
Simon Vieille 2022-03-10 22:29:45 +01:00
parent bd6a5bb44e
commit 3017880a64

View file

@ -51,16 +51,14 @@ class RequestSecurityEventSubscriber implements EventSubscriberInterface
$isGranted = $this->authorizationChecker->isGranted($role);
if ('or' === $operator && $isGranted) {
$isAuthorized = true;
return;
} elseif ('and' === $operator && !$isGranted) {
throw $exception;
}
}
if (!$isAuthorized) {
throw $exception;
}
}
public static function getSubscribedEvents(): array
{