Verifies that the current user can access the requested path.
\Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The Event to process.
public function onKernelRequestAccessCheck(GetResponseEvent $event) {
$request = $event
->getRequest();
if (!$request->attributes
->has('_route')) {
// If no Route is available it is likely a static resource and access is
// handled elsewhere.
return;
}
$this->accessManager
->check($request->attributes
->get('_route'));
}