Skip to content

Commit d1b4ea9

Browse files
committed
Removed the deprecated feature
1 parent 3d10914 commit d1b4ea9

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

security/access_control.rst

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ Take the following ``access_control`` entries as an example:
4444
- { path: '^/admin', roles: ROLE_USER_PORT, ip: 127.0.0.1, port: 8080 }
4545
- { path: '^/admin', roles: ROLE_USER_HOST, host: symfony\.com$ }
4646
- { path: '^/admin', roles: ROLE_USER_METHOD, methods: [POST, PUT] }
47-
# when defining multiple roles, users must have at least one of them (it's like an OR condition)
48-
- { path: '^/admin', roles: [ROLE_MANAGER, ROLE_ADMIN] }
4947
5048
.. code-block:: xml
5149
@@ -63,8 +61,6 @@ Take the following ``access_control`` entries as an example:
6361
<rule path="^/admin" role="ROLE_USER_PORT" ip="127.0.0.1" port="8080"/>
6462
<rule path="^/admin" role="ROLE_USER_HOST" host="symfony\.com$"/>
6563
<rule path="^/admin" role="ROLE_USER_METHOD" methods="POST, PUT"/>
66-
<!-- when defining multiple roles, users must have at least one of them (it's like an OR condition) -->
67-
<rule path="^/admin" roles="ROLE_ADMIN, ROLE_MANAGER"/>
6864
</config>
6965
</srv:container>
7066
@@ -94,20 +90,10 @@ Take the following ``access_control`` entries as an example:
9490
'path' => '^/admin',
9591
'roles' => 'ROLE_USER_METHOD',
9692
'methods' => 'POST, PUT',
97-
],
98-
[
99-
'path' => '^/admin',
100-
// when defining multiple roles, users must have at least one of them (it's like an OR condition)
101-
'roles' => ['ROLE_MANAGER', 'ROLE_ADMIN'],
102-
],
93+
]
10394
],
10495
]);
10596
106-
.. deprecated:: 4.4
107-
108-
Using more than one role in a single ``access_control`` rule is deprecated
109-
and will stop working in Symfony 5.0.
110-
11197
For each incoming request, Symfony will decide which ``access_control``
11298
to use based on the URI, the client's IP address, the incoming host name,
11399
and the request method. Remember, the first rule that matches is used, and
@@ -135,11 +121,6 @@ if ``ip``, ``port``, ``host`` or ``method`` are not specified for an entry, that
135121
| ``/admin/user`` | 168.0.0.1 | 80 | example.com | POST | rule #4 (``ROLE_USER_METHOD``) | The ``ip`` and ``host`` don't match the first two entries, |
136122
| | | | | | | but the third - ``ROLE_USER_METHOD`` - matches and is used. |
137123
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
138-
| ``/admin/user`` | 168.0.0.1 | 80 | example.com | GET | rule #4 (``ROLE_MANAGER``) | The ``ip``, ``host`` and ``method`` prevent the first |
139-
| | | | | | | three entries from matching. But since the URI matches the |
140-
| | | | | | | ``path`` pattern, then the ``ROLE_MANAGER`` (or the |
141-
| | | | | | | ``ROLE_ADMIN``) is used. |
142-
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
143124
| ``/foo`` | 127.0.0.1 | 80 | symfony.com | POST | matches no entries | This doesn't match any ``access_control`` rules, since its |
144125
| | | | | | | URI doesn't match any of the ``path`` values. |
145126
+-----------------+-------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
@@ -155,13 +136,7 @@ options:
155136

156137
* ``roles`` If the user does not have the given role, then access is denied
157138
(internally, an :class:`Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException`
158-
is thrown). If this value is an array of multiple roles, the user must have
159-
at least one of them.
160-
161-
.. deprecated:: 4.4
162-
163-
Using more than one role in a single ``access_control`` rule is deprecated
164-
and will stop working in Symfony 5.0.
139+
is thrown).
165140

166141
* ``allow_if`` If the expression returns false, then access is denied;
167142

0 commit comments

Comments
 (0)