File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,36 @@ application configuration file with the following code.
198198 That's it! Now, when deciding whether or not a user should have access,
199199the new voter will deny access to any user in the list of blacklisted IPs.
200200
201+ Note that the voters are only called, if any access is actually checked. So
202+ you need at least something like
203+
204+ .. configuration-block ::
205+
206+ .. code-block :: yaml
207+
208+ # app/config/security.yml
209+ security :
210+ access_control :
211+ - { path: ^/, role: IS_AUTHENTICATED_ANONYMOUSLY }
212+
213+ .. code-block :: xml
214+
215+ <!-- app/config/security.xml -->
216+ <config >
217+ <access-control >
218+ <rule path =" ^/" role =" IS_AUTHENTICATED_ANONYMOUSLY" />
219+ </access-control >
220+ </config >
221+
222+ .. code-block :: php
223+
224+ // app/config/security.xml
225+ $container->loadFromExtension('security', array(
226+ 'access_control' => array(
227+ array('path' => '^/', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY'),
228+ ),
229+ ));
230+
201231 .. seealso ::
202232
203233 For a more advanced usage see
You can’t perform that action at this time.
0 commit comments