Skip to content

Commit 17f5a01

Browse files
committed
minor symfony#12763 Minor tweak in a security expression explanation (javiereguiluz)
This PR was merged into the 3.4 branch. Discussion ---------- Minor tweak in a security expression explanation I was checking https://symfony.com/doc/current/security/expressions.html and I was going to submit a PR to fix this -> `"ROLE_ADMIN" in roles ...` But then I read that `roles` in expressions contains ALL roles (it "flattens" the role hierarchy) which is very different from what happens in other parts of Symfony. So maybe we could tweak the description a bit to make this special behavior more obvious? Commits ------- 8438276 Minor tweak in a security expression explanation
2 parents d677893 + 8438276 commit 17f5a01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

security/expressions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ Inside the expression, you have access to a number of variables:
3939
``user``
4040
The user object (or the string ``anon`` if you're not authenticated).
4141
``roles``
42-
The array of roles the user has, including from the
43-
:ref:`role hierarchy <security-role-hierarchy>` but not including the
44-
``IS_AUTHENTICATED_*`` attributes (see the functions below).
42+
The array of roles the user has. This array includes any roles granted
43+
indirectly via the :ref:`role hierarchy <security-role-hierarchy>` but it
44+
does not include the ``IS_AUTHENTICATED_*`` attributes (see the functions below).
4545
``object``
4646
The object (if any) that's passed as the second argument to ``isGranted()``.
4747
``token``

0 commit comments

Comments
 (0)