classes/ngsymfonytoolsisgrantedoperator.php
public static function isGranted( $role, $object = null, $field = null )
    {
        $serviceContainer = ezpKernel::instance()->getServiceContainer();

        if ( $field !== null && class_exists( 'Symfony\Component\Security\Acl\Voter\FieldVote' ) )
        {
            $object = new FieldVote( $object, $field );
        }

        try
        {
            return $serviceContainer->get( 'security.authorization_checker' )->isGranted( $role, $object );
        }
        catch ( AuthenticationCredentialsNotFoundException $e )
        {
            return false;
        }
    }
public static function isGranted( $role, $object = null, $field = null )
    {
        $serviceContainer = ezpKernel::instance()->getServiceContainer();

        if ( $field !== null && class_exists( 'Symfony\Component\Security\Acl\Voter\FieldVote' ) )
        {
            $object = new FieldVote( $object, $field );
        }

        try
        {
            return $serviceContainer->get( 'security.authorization_checker' )->isGranted( $role, $object );
        }
        catch ( AuthenticationCredentialsNotFoundException $e )
        {
            return false;
        }
    }
public static function isGranted ( $ role , $ object = null , $ field = null ) { $ serviceContainer = ezpKernel :: instance ( ) -> getServiceContainer ( ) ; if ( $ field !== null && class_exists ( 'Symfony\Component\Security\Acl\Voter\FieldVote' ) ) { $ object = new FieldVote ( $ object , $ field ) ; } try { return $ serviceContainer -> get ( 'security.authorization_checker' ) -> isGranted ( $ role , $ object ) ; } catch ( AuthenticationCredentialsNotFoundException $ e ) { return false ; } }
Returns if the current user has access to provided role.

@param mixed $role
@param mixed $object
@param mixed $field

@return bool
Returns if the current user has access to provided role .