3
votes

With the Symfony Voters system it's pretty easy to get a good ACL up and running for a web app. However, you have to decide in the beginning, what strategy you'd like to use.

Symfony supports 3 strategies: affirmative, consensus and unanimous (see their documentation)

affirmative (default): This grants access as soon as there is one voter granting access;
consensus: This grants access if there are more voters granting access than denying;
unanimous: This only grants access once all voters grant access.

I'm currently using the affirmative strategy. In one special case (so far, maybe there'll be more in the future), I need to use the unanimous strategy.

Is there a way to do this or do I just have to make a custom checking system there (copy the code of all involved voters)?

1

1 Answers

0
votes

Have you tried extending Symfony's AccessDecisionManager by your custom class with own strategy and registering it at service container? You can checkout the implementation of this class and see that you can define your own strategy by creating a simple method inside the class.

The other option is you can try to use access_control and allow_if as said here