refactoring of RequestSecurityEventSubscriber
This commit is contained in:
parent
bd6a5bb44e
commit
3017880a64
|
@ -51,16 +51,14 @@ class RequestSecurityEventSubscriber implements EventSubscriberInterface
|
||||||
$isGranted = $this->authorizationChecker->isGranted($role);
|
$isGranted = $this->authorizationChecker->isGranted($role);
|
||||||
|
|
||||||
if ('or' === $operator && $isGranted) {
|
if ('or' === $operator && $isGranted) {
|
||||||
$isAuthorized = true;
|
return;
|
||||||
} elseif ('and' === $operator && !$isGranted) {
|
} elseif ('and' === $operator && !$isGranted) {
|
||||||
throw $exception;
|
throw $exception;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$isAuthorized) {
|
|
||||||
throw $exception;
|
throw $exception;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static function getSubscribedEvents(): array
|
public static function getSubscribedEvents(): array
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue