Voter/ClassVoter.php
public function vote(TokenInterface $token, $object, array $attributes): int
    {
        $result = VoterInterface::ACCESS_ABSTAIN;

        if (!\is_string($object)) {
            return $result;
        }

        if (!array_key_exists($object, $this->classPermissions)) {
            return $result;
        }

        $permissions = $this->classPermissions[$object];

        $result = VoterInterface::ACCESS_DENIED;
        foreach ($attributes as $attribute) {
            if (!array_key_exists($attribute, $permissions)) {
                return VoterInterface::ACCESS_GRANTED; // No permissions means access is granted
            }
            if (null === $permissions[$attribute]) {
                return VoterInterface::ACCESS_GRANTED; // Null means access granted
            }

            if ($this->decisionManager->decide($token, (array) $permissions[$attribute])) {
                return VoterInterface::ACCESS_GRANTED;
            }
        }

        return $result;
    }
public function vote(TokenInterface $token, $object, array $attributes): int
    {
        $result = VoterInterface::ACCESS_ABSTAIN;

        if (!\is_string($object)) {
            return $result;
        }

        if (!array_key_exists($object, $this->classPermissions)) {
            return $result;
        }

        $permissions = $this->classPermissions[$object];

        $result = VoterInterface::ACCESS_DENIED;
        foreach ($attributes as $attribute) {
            if (!array_key_exists($attribute, $permissions)) {
                return VoterInterface::ACCESS_GRANTED; // No permissions means access is granted
            }
            if (null === $permissions[$attribute]) {
                return VoterInterface::ACCESS_GRANTED; // Null means access granted
            }

            if ($this->decisionManager->decide($token, (array) $permissions[$attribute])) {
                return VoterInterface::ACCESS_GRANTED;
            }
        }

        return $result;
    }
public function vote ( TokenInterface $ token , $ object , array $ attributes ) : int { $ result = VoterInterface :: ACCESS_ABSTAIN ; if ( ! \ is_string ( $ object ) ) { return $ result ; } if ( ! array_key_exists ( $ object , $ this -> classPermissions ) ) { return $ result ; } $ permissions = $ this -> classPermissions [ $ object ] ; $ result = VoterInterface :: ACCESS_DENIED ; foreach ( $ attributes as $ attribute ) { if ( ! array_key_exists ( $ attribute , $ permissions ) ) { return VoterInterface :: ACCESS_GRANTED ; // No permissions means access is granted } if ( null === $ permissions [ $ attribute ] ) { return VoterInterface :: ACCESS_GRANTED ; // Null means access granted } if ( $ this -> decisionManager -> decide ( $ token , ( array ) $ permissions [ $ attribute ] ) ) { return VoterInterface :: ACCESS_GRANTED ; } } return $ result ; }
{@inheritdoc}

@throws \Exception
{ @inheritdoc }