@@ -780,27 +780,27 @@ Take the following ``access_control`` entries as an example:
780
780
security :
781
781
# ...
782
782
access_control :
783
- - { path: ^/user , roles: ROLE_USER_IP, ip: 127.0.0.1 }
784
- - { path: ^/user , roles: ROLE_USER_HOST, host: symfony.com }
785
- - { path: ^/user , roles: ROLE_USER_METHOD, methods: [POST, PUT] }
786
- - { path: ^/user , roles: ROLE_USER }
783
+ - { path: ^/admin , roles: ROLE_USER_IP, ip: 127.0.0.1 }
784
+ - { path: ^/admin , roles: ROLE_USER_HOST, host: symfony.com }
785
+ - { path: ^/admin , roles: ROLE_USER_METHOD, methods: [POST, PUT] }
786
+ - { path: ^/admin , roles: ROLE_USER }
787
787
788
788
.. code-block :: xml
789
789
790
790
<access-control >
791
- <rule path =" ^/user " role =" ROLE_USER_IP" ip =" 127.0.0.1" />
792
- <rule path =" ^/user " role =" ROLE_USER_HOST" host =" symfony.com" />
793
- <rule path =" ^/user " role =" ROLE_USER_METHOD" method =" POST, PUT" />
794
- <rule path =" ^/user " role =" ROLE_USER" />
791
+ <rule path =" ^/admin " role =" ROLE_USER_IP" ip =" 127.0.0.1" />
792
+ <rule path =" ^/admin " role =" ROLE_USER_HOST" host =" symfony.com" />
793
+ <rule path =" ^/admin " role =" ROLE_USER_METHOD" method =" POST, PUT" />
794
+ <rule path =" ^/admin " role =" ROLE_USER" />
795
795
</access-control >
796
796
797
797
.. code-block :: php
798
798
799
799
'access_control' => array(
800
- array('path' => '^/user ', 'role' => 'ROLE_USER_IP', 'ip' => '127.0.0.1'),
801
- array('path' => '^/user ', 'role' => 'ROLE_USER_HOST', 'host' => 'symfony.com'),
802
- array('path' => '^/user ', 'role' => 'ROLE_USER_METHOD', 'method' => 'POST, PUT'),
803
- array('path' => '^/user ', 'role' => 'ROLE_USER'),
800
+ array('path' => '^/admin ', 'role' => 'ROLE_USER_IP', 'ip' => '127.0.0.1'),
801
+ array('path' => '^/admin ', 'role' => 'ROLE_USER_HOST', 'host' => 'symfony.com'),
802
+ array('path' => '^/admin ', 'role' => 'ROLE_USER_METHOD', 'method' => 'POST, PUT'),
803
+ array('path' => '^/admin ', 'role' => 'ROLE_USER'),
804
804
),
805
805
806
806
For each incoming request, Symfony will decided which ``access_control ``
@@ -904,18 +904,18 @@ given prefix, ``/esi``, from outside access:
904
904
Here is how it works when the path is ``/esi/something `` coming from the
905
905
``10.0.0.1 `` IP:
906
906
907
- * The first access control rule does not match and is ignored as the ``path ``
908
- matches but the ``ip `` does not;
907
+ * The first access control rule is ignored as the ``path `` matches but the
908
+ ``ip `` does not;
909
909
910
- * The second access control rule matches (the only restriction being the
910
+ * The second access control rule is enabled (the only restriction being the
911
911
``path `` and it matches): as the user cannot have the ``ROLE_NO_ACCESS ``
912
912
role as it's not defined, access is denied (the ``ROLE_NO_ACCESS `` role can
913
913
be anything that does not match an existing role, it just serves as a trick
914
914
to always deny access).
915
915
916
916
Now, if the same request comes from ``127.0.0.1 ``:
917
917
918
- * Now, the first access control rule does match as both the ``path `` and the
918
+ * Now, the first access control rule is enabled as both the ``path `` and the
919
919
``ip `` match: access is allowed as the user always has the
920
920
``IS_AUTHENTICATED_ANONYMOUSLY `` role.
921
921
0 commit comments