symfony2 more than one security voter for a bundle

0

I'm having trouble creating more than one voter for each class

The idea is to have a voter for each class to be able to perform security access to it, the first voter worked but the second always denied access

I also noticed that in services.yml it is only possible to add one, would it be possible to create more than one voter for a bundle?

example:

security.access.post_voter:
        class:      AppBundle\Security\Authorization\Voter\StateVoter
        public:     false
        tags:
            - { name: security.voter }

security.access.post_voter:
        class:      AppBundle\Security\Authorization\Voter\CityVoter
        public:     false
        tags:
            - { name: security.voter }

It does not let you repeat security.acess.post_voter

    
asked by anonymous 22.10.2015 / 21:27

1 answer

0

The problem was because it does not have to be called a post_voter, I was wrong in the tutorial

security.access.state_voter:
        class:      AppBundle\Security\Authorization\Voter\StateVoter
        public:     false
        tags:
            - { name: security.voter }

security.access.city_voter:
        class:      AppBundle\Security\Authorization\Voter\CityVoter
        public:     false
        tags:
            - { name: security.voter }

All right now

    
03.11.2015 / 12:57