Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,9 @@ URL pattern. You saw this earlier, where anything matching the regular expressio
# require ROLE_ADMIN for /admin*
- { path: '^/admin', roles: ROLE_ADMIN }

# or require ROLE_ADMIN and IS_AUTHENTICATED_FULLY for /admin*
- { path: '^/admin', roles: [IS_AUTHENTICATED_FULLY, ROLE_ADMIN] }

# the 'path' value can be any valid regular expression
# (this one will match URLs like /api/post/7298 and /api/comment/528491)
- { path: ^/api/(post|comment)/\d+$, roles: ROLE_USER }
Expand All @@ -739,6 +742,12 @@ URL pattern. You saw this earlier, where anything matching the regular expressio
<!-- require ROLE_ADMIN for /admin* -->
<rule path="^/admin" role="ROLE_ADMIN"/>

<!-- require ROLE_ADMIN and IS_AUTHENTICATED_FULLY for /admin* -->
<rule path="^/admin">
<role>ROLE_ADMIN</role>
<role>IS_AUTHENTICATED_FULLY</role>
</rule>

<!-- the 'path' value can be any valid regular expression
(this one will match URLs like /api/post/7298 and /api/comment/528491) -->
<rule path="^/api/(post|comment)/\d+$" role="ROLE_USER"/>
Expand All @@ -761,6 +770,9 @@ URL pattern. You saw this earlier, where anything matching the regular expressio
// require ROLE_ADMIN for /admin*
['path' => '^/admin', 'roles' => 'ROLE_ADMIN'],

// require ROLE_ADMIN and IS_AUTHENTICATED_FULLY for /admin*
['path' => '^/admin', 'roles' => ['ROLE_ADMIN', 'IS_AUTHENTICATED_FULLY']],

// the 'path' value can be any valid regular expression
// (this one will match URLs like /api/post/7298 and /api/comment/528491)
['path' => '^/api/(post|comment)/\d+$', 'roles' => 'ROLE_USER'],
Expand Down