Symfony\Bundle\FrameworkBundle\Controller\Controller::denyAccessUnlessGranted PHP Method

denyAccessUnlessGranted() protected method

Throws an exception unless the attributes are granted against the current authentication token and optionally supplied object.
protected denyAccessUnlessGranted ( mixed $attributes, mixed $object = null, string $message = 'Access Denied.' )
$attributes mixed The attributes
$object mixed The object
$message string The message passed to the exception
    protected function denyAccessUnlessGranted($attributes, $object = null, $message = 'Access Denied.')
    {
        if (!$this->isGranted($attributes, $object)) {
            $exception = $this->createAccessDeniedException($message);
            $exception->setAttributes($attributes);
            $exception->setSubject($object);
            throw $exception;
        }
    }

Usage Example

 public function denyAccessUnlessGranted($attributes, $object = null, $message = 'Access Denied.')
 {
     parent::denyAccessUnlessGranted($attributes, $object, $message);
 }
All Usage Examples Of Symfony\Bundle\FrameworkBundle\Controller\Controller::denyAccessUnlessGranted