public function vote(TokenInterface $token, $object, array $attributes)
    {
        foreach ($attributes as $attribute) {
            if ($this->supportsAttribute($attribute)) {
                $targets = isset($attribute->limitations['targets']) ? $attribute->limitations['targets'] : null;
                if (
                    $this->repository->canUser(
                        $attribute->module,
                        $attribute->function,
                        $attribute->limitations['valueObject'],
                        $targets
                    ) === false
                ) {
                    return VoterInterface::ACCESS_DENIED;
                }

                return VoterInterface::ACCESS_GRANTED;
            }
        }

        return VoterInterface::ACCESS_ABSTAIN;
    }
public function vote(TokenInterface $token, $object, array $attributes)
    {
        foreach ($attributes as $attribute) {
            if ($this->supportsAttribute($attribute)) {
                $targets = isset($attribute->limitations['targets']) ? $attribute->limitations['targets'] : null;
                if (
                    $this->repository->canUser(
                        $attribute->module,
                        $attribute->function,
                        $attribute->limitations['valueObject'],
                        $targets
                    ) === false
                ) {
                    return VoterInterface::ACCESS_DENIED;
                }

                return VoterInterface::ACCESS_GRANTED;
            }
        }

        return VoterInterface::ACCESS_ABSTAIN;
    }
public function vote ( TokenInterface $ token , $ object , array $ attributes ) { foreach ( $ attributes as $ attribute ) { if ( $ this -> supportsAttribute ( $ attribute ) ) { $ targets = isset ( $ attribute -> limitations [ 'targets' ] ) ? $ attribute -> limitations [ 'targets' ] : null ; if ( $ this -> repository -> canUser ( $ attribute -> module , $ attribute -> function , $ attribute -> limitations [ 'valueObject' ] , $ targets ) === false ) { return VoterInterface :: ACCESS_DENIED ; } return VoterInterface :: ACCESS_GRANTED ; } } return VoterInterface :: ACCESS_ABSTAIN ; }
Returns the vote for the given parameters.
Checks if user has access to a given action on a given value object.

$attributes->limitations is a hash that contains:
- 'valueObject' - The ValueObject to check access on (eZ\Publish\API\Repository\Values\ValueObject). e.g. Location or Content.
- 'targets' - The location, parent or "assignment" value object, or an array of the same.

This method must return one of the following constants:
ACCESS_GRANTED, ACCESS_DENIED, or ACCESS_ABSTAIN.

@see \eZ\Publish\API\Repository\Repository::canUser()

@param TokenInterface $token      A TokenInterface instance
@param object         $object     The object to secure
@param array          $attributes An array of attributes associated with the method being invoked

@return int either ACCESS_GRANTED, ACCESS_ABSTAIN, or ACCESS_DENIED
Returns the vote for the given parameters . Checks if user has access to a given action on a given value object .