@@ -40,8 +40,8 @@ Take the following ``access_control`` entries as an example:
40
40
security :
41
41
# ...
42
42
access_control :
43
- - { path: '^/admin', roles: ROLE_USER_IP, ip: 127.0.0.1 }
44
43
- { path: '^/admin', roles: ROLE_USER_PORT, ip: 127.0.0.1, port: 8080 }
44
+ - { path: '^/admin', roles: ROLE_USER_IP, ip: 127.0.0.1 }
45
45
- { path: '^/admin', roles: ROLE_USER_HOST, host: symfony\.com$ }
46
46
- { path: '^/admin', roles: ROLE_USER_METHOD, methods: [POST, PUT] }
47
47
@@ -59,8 +59,8 @@ Take the following ``access_control`` entries as an example:
59
59
60
60
<config >
61
61
<!-- ... -->
62
- <rule path =" ^/admin" role =" ROLE_USER_IP" ip =" 127.0.0.1" />
63
62
<rule path =" ^/admin" role =" ROLE_USER_PORT" ip =" 127.0.0.1" port =" 8080" />
63
+ <rule path =" ^/admin" role =" ROLE_USER_IP" ip =" 127.0.0.1" />
64
64
<rule path =" ^/admin" role =" ROLE_USER_HOST" host =" symfony\.com$" />
65
65
<rule path =" ^/admin" role =" ROLE_USER_METHOD" methods =" POST, PUT" />
66
66
</config >
@@ -72,17 +72,17 @@ Take the following ``access_control`` entries as an example:
72
72
$container->loadFromExtension('security', [
73
73
// ...
74
74
'access_control' => [
75
- [
76
- 'path' => '^/admin',
77
- 'roles' => 'ROLE_USER_IP',
78
- 'ips' => '127.0.0.1',
79
- ],
80
75
[
81
76
'path' => '^/admin',
82
77
'roles' => 'ROLE_USER_PORT',
83
78
'ip' => '127.0.0.1',
84
79
'port' => '8080',
85
80
],
81
+ [
82
+ 'path' => '^/admin',
83
+ 'roles' => 'ROLE_USER_IP',
84
+ 'ips' => '127.0.0.1',
85
+ ],
86
86
[
87
87
'path' => '^/admin',
88
88
'roles' => 'ROLE_USER_HOST',
@@ -105,13 +105,13 @@ if ``ip``, ``port``, ``host`` or ``method`` are not specified for an entry, that
105
105
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
106
106
| URI | IP | PORT | HOST | METHOD | ``access_control `` | Why? |
107
107
+=================+=============+=============+=============+============+================================+=============================================================+
108
- | ``/admin/user `` | 127.0.0.1 | 80 | example.com | GET | rule #1 (``ROLE_USER_IP ``) | The URI matches ``path `` and the IP matches ``ip ``. |
108
+ | ``/admin/user `` | 127.0.0.1 | 80 | example.com | GET | rule #2 (``ROLE_USER_IP ``) | The URI matches ``path `` and the IP matches ``ip ``. |
109
109
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
110
- | ``/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 |
110
+ | ``/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 |
111
111
| | | | | | | the ``ROLE_USER_HOST `` entry, but *only * the **first ** |
112
112
| | | | | | | ``access_control `` match is used. |
113
113
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
114
- | ``/admin/user `` | 127.0.0.1 | 8080 | symfony.com | GET | rule #2 (``ROLE_USER_PORT ``) | The ``path ``, ``ip `` and ``port `` match. |
114
+ | ``/admin/user `` | 127.0.0.1 | 8080 | symfony.com | GET | rule #1 (``ROLE_USER_PORT ``) | The ``path ``, ``ip `` and ``port `` match. |
115
115
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
116
116
| ``/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 |
117
117
| | | | | | | rule (which matches) is used. |
0 commit comments