$request->attributes->
remove('_access_control_attributes'
);
if (!
$attributes || ( [AuthenticatedVoter::PUBLIC_ACCESS
] ===
$attributes &&
$event instanceof LazyResponseEvent
)) { return;
} $token =
$this->tokenStorage->
getToken() ??
new NullToken();
if (!
$this->accessDecisionManager->
decide($token,
$attributes,
$request, true
)) { throw $this->
createAccessDeniedException($request,
$attributes);
} } private function createAccessDeniedException(Request
$request, array
$attributes): AccessDeniedException
{ $exception =
new AccessDeniedException();
$exception->
setAttributes($attributes);
$exception->
setSubject($request);
return $exception;
}