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);
}