Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit206e613

Browse files
committed
bug#4304 [DX] Suggest a hint to any auth-check (larsborn)
This PR was submitted for the 2.5 branch but it was merged into the 2.3 branch instead (closes#4304).Discussion----------[DX] Suggest a hint to any auth-checkSuggest a hint that you need a minimum of auth-check to let the voters vote.Commits-------ccdda87 Suggest a hint to any auth-check
2 parentsa801d57 +ccdda87 commit206e613

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

‎cookbook/security/voters.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff 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,
199199
the 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+
<rulepath="^/"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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp