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;
        }
    }