Skip to content

Commit c6484aa

Browse files
include xml and php examples
1 parent 9617742 commit c6484aa

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

security.rst

+10-1
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ start with ``/admin``, you can:
440440
441441
# or require ROLE_ADMIN and IS_AUTHENTICATED_FULLY for /admin*
442442
- { path: '^/admin', roles: [IS_AUTHENTICATED_FULLY, ROLE_ADMIN] }
443-
443+
444444
# the 'path' value can be any valid regular expression
445445
# (this one will match URLs like /api/post/7298 and /api/comment/528491)
446446
- { path: ^/api/(post|comment)/\d+$, roles: ROLE_USER }
@@ -465,6 +465,12 @@ start with ``/admin``, you can:
465465
<!-- require ROLE_ADMIN for /admin* -->
466466
<rule path="^/admin" role="ROLE_ADMIN"/>
467467
468+
<!-- require ROLE_ADMIN and IS_AUTHENTICATED_FULLY for /admin* -->
469+
<rule path="^/admin">
470+
<role>ROLE_ADMIN</role>
471+
<role>IS_AUTHENTICATED_FULLY</role>
472+
</rule>
473+
468474
<!-- the 'path' value can be any valid regular expression
469475
(this one will match URLs like /api/post/7298 and /api/comment/528491) -->
470476
<rule path="^/api/(post|comment)/\d+$" role="ROLE_USER"/>
@@ -487,6 +493,9 @@ start with ``/admin``, you can:
487493
// require ROLE_ADMIN for /admin*
488494
['path' => '^/admin', 'roles' => 'ROLE_ADMIN'],
489495
496+
// require ROLE_ADMIN and IS_AUTHENTICATED_FULLY for /admin*
497+
['path' => '^/admin', 'roles' => ['ROLE_ADMIN', 'IS_AUTHENTICATED_FULLY']],
498+
490499
// the 'path' value can be any valid regular expression
491500
// (this one will match URLs like /api/post/7298 and /api/comment/528491)
492501
['path' => '^/api/(post|comment)/\d+$', 'roles' => 'ROLE_USER'],

0 commit comments

Comments
 (0)