Skip to content

Commit 31fae29

Browse files
committed
Added more realistic examples
1 parent 1f4975e commit 31fae29

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

security.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,8 @@ URL pattern. You saw this earlier, where anything matching the regular expressio
716716
- { path: ^/admin, roles: ROLE_ADMIN }
717717
718718
# the 'path' value can be any valid regular expression
719-
# (this one will match URLs like /api/entity1/528491 and /api/entity2/528491)
720-
- { path: ^/api/(entity1|entity2)/\d+$, roles: ROLE_USER }
719+
# (this one will match URLs like /api/post/7298 and /api/comment/528491)
720+
- { path: ^/api/(post|comment)/\d+$, roles: ROLE_USER }
721721
722722
.. code-block:: xml
723723
@@ -740,8 +740,8 @@ URL pattern. You saw this earlier, where anything matching the regular expressio
740740
<rule path="^/admin" role="ROLE_ADMIN"/>
741741
742742
<!-- the 'path' value can be any valid regular expression
743-
(this one will match URLs like /api/entity1/528491 and /api/entity2/528491) -->
744-
<rule path="^/api/(entity1|entity2)/\d+$" role="ROLE_USER"/>
743+
(this one will match URLs like /api/post/7298 and /api/comment/528491) -->
744+
<rule path="^/api/(post|comment)/\d+$" role="ROLE_USER"/>
745745
</config>
746746
</srv:container>
747747
@@ -762,8 +762,8 @@ URL pattern. You saw this earlier, where anything matching the regular expressio
762762
['path' => '^/admin', 'role' => 'ROLE_ADMIN'],
763763
764764
// the 'path' value can be any valid regular expression
765-
// (this one will match URLs like /api/entity1/528491 and /api/entity2/528491)
766-
['path' => '^/api/(entity1|entity2)/\d+$', 'role' => 'ROLE_USER'],
765+
// (this one will match URLs like /api/post/7298 and /api/comment/528491)
766+
['path' => '^/api/(post|comment)/\d+$', 'role' => 'ROLE_USER'],
767767
],
768768
]);
769769

0 commit comments

Comments
 (0)