@@ -43,8 +43,8 @@ Take the following ``access_control`` entries as an example:
43
43
security :
44
44
# ...
45
45
access_control :
46
- - { path: '^/admin', roles: ROLE_USER_IP, ip: 127.0.0.1 }
47
46
- { path: '^/admin', roles: ROLE_USER_PORT, ip: 127.0.0.1, port: 8080 }
47
+ - { path: '^/admin', roles: ROLE_USER_IP, ip: 127.0.0.1 }
48
48
- { path: '^/admin', roles: ROLE_USER_HOST, host: symfony\.com$ }
49
49
- { path: '^/admin', roles: ROLE_USER_METHOD, methods: [POST, PUT] }
50
50
@@ -70,8 +70,8 @@ Take the following ``access_control`` entries as an example:
70
70
71
71
<config >
72
72
<!-- ... -->
73
- <rule path =" ^/admin" role =" ROLE_USER_IP" ip =" 127.0.0.1" />
74
73
<rule path =" ^/admin" role =" ROLE_USER_PORT" ip =" 127.0.0.1" port =" 8080" />
74
+ <rule path =" ^/admin" role =" ROLE_USER_IP" ip =" 127.0.0.1" />
75
75
<rule path =" ^/admin" role =" ROLE_USER_HOST" host =" symfony\.com$" />
76
76
<rule path =" ^/admin" role =" ROLE_USER_METHOD" methods =" POST, PUT" />
77
77
@@ -92,17 +92,17 @@ Take the following ``access_control`` entries as an example:
92
92
$container->loadFromExtension('security', [
93
93
// ...
94
94
'access_control' => [
95
- [
96
- 'path' => '^/admin',
97
- 'roles' => 'ROLE_USER_IP',
98
- 'ips' => '127.0.0.1',
99
- ],
100
95
[
101
96
'path' => '^/admin',
102
97
'roles' => 'ROLE_USER_PORT',
103
98
'ip' => '127.0.0.1',
104
99
'port' => '8080',
105
100
],
101
+ [
102
+ 'path' => '^/admin',
103
+ 'roles' => 'ROLE_USER_IP',
104
+ 'ips' => '127.0.0.1',
105
+ ],
106
106
[
107
107
'path' => '^/admin',
108
108
'roles' => 'ROLE_USER_HOST',
@@ -145,16 +145,13 @@ if ``ip``, ``port``, ``host`` or ``method`` are not specified for an entry, that
145
145
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
146
146
| URI | IP | PORT | HOST | METHOD | ``access_control `` | Why? |
147
147
+=================+=============+=============+=============+============+================================+=============================================================+
148
- | ``/admin/user `` | 127.0.0.1 | 80 | example.com | GET | rule #1 (``ROLE_USER_IP ``) | The URI matches ``path `` and the IP matches ``ip ``. |
148
+ | ``/admin/user `` | 127.0.0.1 | 80 | example.com | GET | rule #2 (``ROLE_USER_IP ``) | The URI matches ``path `` and the IP matches ``ip ``. |
149
149
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
150
- | ``/admin/user `` | 127.0.0.1 | 80 | symfony.com | GET | rule #1 (``ROLE_USER_IP ``) | The ``path `` and ``ip `` still match. This would also match |
150
+ | ``/admin/user `` | 127.0.0.1 | 80 | symfony.com | GET | rule #2 (``ROLE_USER_IP ``) | The ``path `` and ``ip `` still match. This would also match |
151
151
| | | | | | | the ``ROLE_USER_HOST `` entry, but *only * the **first ** |
152
152
| | | | | | | ``access_control `` match is used. |
153
153
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
154
- | ``/admin/user `` | 127.0.0.1 | 8080 | symfony.com | GET | rule #1 (``ROLE_USER_IP ``) | The ``path `` and ``ip `` still match. This would also match |
155
- | | | | | | | the ``port `` entry (``ROLE_USER_PORT ``) and the ``host `` |
156
- | | | | | | | enrty (``ROLE_USER_HOST ``), but only the **first ** matched |
157
- | | | | | | | ``access_control `` is used. |
154
+ | ``/admin/user `` | 127.0.0.1 | 8080 | symfony.com | GET | rule #1 (``ROLE_USER_PORT ``) | The path, ip and port match. |
158
155
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
159
156
| ``/admin/user `` | 168.0.0.1 | 80 | symfony.com | GET | rule #3 (``ROLE_USER_HOST ``) | The ``ip `` doesn't match the first rule, so the second |
160
157
| | | | | | | rule (which matches) is used. |
0 commit comments