@@ -44,7 +44,7 @@ Take the following ``access_control`` entries as an example:
44
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
- # when defining multiple roles, users must have at least one of them (it's like an OR condition)
47
+ # when defining multiple roles, it could be like an OR or AND condition depending on the 'affirmative' or 'unanimous' strategy used
48
48
- { path: '^/admin', roles: [ROLE_MANAGER, ROLE_ADMIN] }
49
49
50
50
.. code-block :: xml
@@ -63,7 +63,7 @@ Take the following ``access_control`` entries as an example:
63
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
- <!-- when defining multiple roles, users must have at least one of them (it's like an OR condition) -->
66
+ <!-- when defining multiple roles, it could be like an OR or AND condition depending on the 'affirmative' or 'unanimous' strategy used -->
67
67
<rule path =" ^/admin" roles =" ROLE_ADMIN, ROLE_MANAGER" />
68
68
</config >
69
69
</srv : container >
@@ -97,7 +97,7 @@ Take the following ``access_control`` entries as an example:
97
97
],
98
98
[
99
99
'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, it could be like an OR or AND condition depending on the 'affirmative' or 'unanimous' strategy used
101
101
'roles' => ['ROLE_MANAGER', 'ROLE_ADMIN'],
102
102
],
103
103
],
@@ -156,7 +156,8 @@ options:
156
156
157
157
* ``roles `` If the user does not have the given role, then access is denied
158
158
(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
159
+ is thrown). If this value is an array of multiple roles, the user must have:
160
+
160
161
* at least one of them when using the default ``affirmative `` strategy
161
162
* all of them when using the ``unanimous `` strategy
162
163
in the :ref: `Access Decision Manager <components-security-access-decision-manager >`.
0 commit comments