Skip to content

Commit f96aca8

Browse files
committed
[Security] Add mention to is_granted expression
1 parent a309c60 commit f96aca8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

book/security.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,6 +1786,8 @@ Additionally, you have access to a number of functions inside the expression:
17861786
see below;
17871787
* ``has_role``: Checks to see if the user has the given role - equivalent
17881788
to an expression like ``'ROLE_ADMIN' in roles``.
1789+
* ``is_granted``: Similar to the php code like `$securityContext->isGranted('ROLE_USER')`.
1790+
Unlike `has_role` expression, `is_granted` will call your custom voters if defined.
17891791

17901792
.. sidebar:: ``is_remember_me`` is different than checking ``IS_AUTHENTICATED_REMEMBERED``
17911793

0 commit comments

Comments
 (0)