This will result in a 403 response code. Usage example:
throw $this->createAccessDeniedException('Unable to access this page!');
protected createAccessDeniedException ( string $message = 'Access Denied.', Exception $previous = null ) : Symfony\Component\Security\Core\Exception\AccessDeniedException | ||
$message | string | A message |
$previous | Exception | The previous exception |
return | Symfony\Component\Security\Core\Exception\AccessDeniedException |