Skip to content

Commit e905f32

Browse files
ajgarlagwouterj
authored andcommitted
Partially revert "fix voting on multiple roles behavior description" due to CVE-2020-5275
1 parent d987792 commit e905f32

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

security.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ start with ``/admin``, you can:
513513
# require ROLE_ADMIN for /admin*
514514
- { path: '^/admin', roles: ROLE_ADMIN }
515515
516-
# or require ROLE_ADMIN or IS_AUTHENTICATED_FULLY for /admin*
516+
# or require multiple roles for /admin* (when defining multiple roles, the behavior depends on the strategy used in Access Decission Manager)
517517
- { path: '^/admin', roles: [IS_AUTHENTICATED_FULLY, ROLE_ADMIN] }
518518
519519
# the 'path' value can be any valid regular expression
@@ -540,7 +540,7 @@ start with ``/admin``, you can:
540540
<!-- require ROLE_ADMIN for /admin* -->
541541
<rule path="^/admin" role="ROLE_ADMIN"/>
542542
543-
<!-- require ROLE_ADMIN or IS_AUTHENTICATED_FULLY for /admin* -->
543+
<!-- require multiple roles for /admin* (when defining multiple roles, the behavior depends on the strategy used in Access Decission Manager) -->
544544
<rule path="^/admin">
545545
<role>ROLE_ADMIN</role>
546546
<role>IS_AUTHENTICATED_FULLY</role>
@@ -568,7 +568,7 @@ start with ``/admin``, you can:
568568
// require ROLE_ADMIN for /admin*
569569
['path' => '^/admin', 'roles' => 'ROLE_ADMIN'],
570570
571-
// require ROLE_ADMIN or IS_AUTHENTICATED_FULLY for /admin*
571+
// require multiple roles for /admin* (when defining multiple roles, the behavior depends on the strategy used in Access Decission Manager)
572572
['path' => '^/admin', 'roles' => ['ROLE_ADMIN', 'IS_AUTHENTICATED_FULLY']],
573573
574574
// the 'path' value can be any valid regular expression

security/access_control.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Take the following ``access_control`` entries as an example:
4444
- { path: '^/admin', roles: ROLE_USER_IP, ip: 127.0.0.1 }
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)
47+
# when defining multiple roles, the behavior depends on the strategy used in Access Decission Manager
4848
- { path: '^/admin', roles: [ROLE_MANAGER, ROLE_ADMIN] }
4949
5050
.. code-block:: xml
@@ -63,7 +63,7 @@ Take the following ``access_control`` entries as an example:
6363
<rule path="^/admin" role="ROLE_USER_IP" ip="127.0.0.1"/>
6464
<rule path="^/admin" role="ROLE_USER_HOST" host="symfony\.com$"/>
6565
<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) -->
66+
<!-- when defining multiple roles, the behavior depends on the strategy used in Access Decission Manager -->
6767
<rule path="^/admin" roles="ROLE_ADMIN, ROLE_MANAGER"/>
6868
</config>
6969
</srv:container>
@@ -97,7 +97,7 @@ Take the following ``access_control`` entries as an example:
9797
],
9898
[
9999
'path' => '^/admin',
100-
// when defining multiple roles, users must have at least one of them (it's like an OR condition)
100+
// when defining multiple roles, the behavior depends on the strategy used in Access Decission Manager
101101
'roles' => ['ROLE_MANAGER', 'ROLE_ADMIN'],
102102
],
103103
],
@@ -156,8 +156,13 @@ options:
156156

157157
* ``roles`` If the user does not have the given role, then access is denied
158158
(internally, an :class:`Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException`
159-
is thrown). If this value is an array of multiple roles, the user must have
160-
at least one of them.
159+
is thrown). If this value is an array of multiple roles, the user must have:
160+
161+
* at least one of them when using the default ``affirmative`` strategy.
162+
* more granted than denied roles when using the ``consensus`` strategy.
163+
* all of them when using the ``unanimous`` strategy.
164+
165+
For more details about different strategies, see :ref:`Access Decision Manager <components-security-access-decision-manager>`.
161166

162167
* ``allow_if`` If the expression returns false, then access is denied;
163168

0 commit comments

Comments
 (0)