Baikal\AdminBundle\Service\AccessDeniedHandler::handle PHP Метод

handle() публичный Метод

Handles an access denied failure.
public handle ( Request $request, Symfony\Component\Security\Core\Exception\AccessDeniedException $accessDeniedException ) : Response
$request Symfony\Component\HttpFoundation\Request
$accessDeniedException Symfony\Component\Security\Core\Exception\AccessDeniedException
Результат Response may return null
    public function handle(Request $request, AccessDeniedException $accessDeniedException)
    {
        # First we check if user has an access granted to the frontend
        if ($this->securityContext->isGranted('ROLE_FRONTEND_USER')) {
            return new RedirectResponse($this->router->generate('baikal_frontend_homepage'));
        }
        # If not, we display an "Access denied" message
        $attributes = array('_controller' => 'BaikalCoreBundle:Security:accessDenied', 'exception' => $accessDeniedException);
        $subRequest = $request->duplicate(array(), null, $attributes);
        return $this->kernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
    }
AccessDeniedHandler