Skip to content

Commit 233cb32

Browse files
peterrehmweaverryan
authored andcommitted
Added tip regarding VoterInterface restrictions
Added tip about supportsAttribute and supportsClass fixes #2493
1 parent 9bff6ab commit 233cb32

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cookbook/security/voters.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ and compare the IP address against a set of blacklisted IP addresses:
100100
That's it! The voter is done. The next step is to inject the voter into
101101
the security layer. This can be done easily through the service container.
102102

103+
.. tip::
104+
105+
The methods supportsAttribute() and supportsClass() are not being called
106+
internally by the framework. Once you have registered your voter the vote()
107+
method will always be called, not depending on your restrictions. Therefore
108+
you need to call those methods in your implementation of the vote() method.
109+
110+
103111
Declaring the Voter as a Service
104112
--------------------------------
105113

0 commit comments

Comments
 (0)