src/SilexKernel.php
public function isGranted($attributes, $object = null)
    {
        if (!$this->offsetExists('security.authorization_checker')) {
            return false;
        }
        
        $checker = $this['security.authorization_checker'];
        if ($checker instanceof AuthorizationCheckerInterface) {
            try {
                return $checker->isGranted($attributes, $object);
            } catch (AuthenticationCredentialsNotFoundException $e) {
                // authentication not found is considered not granted,
                // there is no need to throw an exception out in this case
                mdebug("Authentication credential not found, isGranted will return false. msg = %s", $e->getMessage());
                
                return false;
            }
        }
        else {
            return false;
        }
    }
public function isGranted($attributes, $object = null)
    {
        if (!$this->offsetExists('security.authorization_checker')) {
            return false;
        }
        
        $checker = $this['security.authorization_checker'];
        if ($checker instanceof AuthorizationCheckerInterface) {
            try {
                return $checker->isGranted($attributes, $object);
            } catch (AuthenticationCredentialsNotFoundException $e) {
                // authentication not found is considered not granted,
                // there is no need to throw an exception out in this case
                mdebug("Authentication credential not found, isGranted will return false. msg = %s", $e->getMessage());
                
                return false;
            }
        }
        else {
            return false;
        }
    }
public function isGranted ( $ attributes , $ object = null ) { if ( ! $ this -> offsetExists ( 'security.authorization_checker' ) ) { return false ; } $ checker = $ this [ 'security.authorization_checker' ] ; if ( $ checker instanceof AuthorizationCheckerInterface ) { try { return $ checker -> isGranted ( $ attributes , $ object ) ; } catch ( AuthenticationCredentialsNotFoundException $ e ) { // authentication not found is considered not granted, // there is no need to throw an exception out in this case mdebug ( "Authentication credential not found, isGranted will return false. msg = %s" , $ e -> getMessage ( ) ) ; return false ; } } else { return false ; } }
Checks if the attributes are granted against the current authentication token and optionally supplied object.

@param mixed $attributes
@param mixed $object

@return bool
Checks if the attributes are granted against the current authentication token and optionally supplied object .