createAccessDeniedException() protected method

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
Example #1
0
 public function createAccessDeniedException($message = 'Access Denied.', \Exception $previous = null)
 {
     return parent::createAccessDeniedException($message, $previous);
 }