diff --git a/book/security.rst b/book/security.rst index beb2724fc22..fdf8922a8d0 100644 --- a/book/security.rst +++ b/book/security.rst @@ -1091,7 +1091,7 @@ Thanks to the SensioFrameworkExtraBundle, you can also secure your controller us use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; /** - * @Security("has_role('ROLE_ADMIN')") + * @Security("is_granted('ROLE_ADMIN')") */ public function helloAction($name) { @@ -1786,6 +1786,8 @@ Additionally, you have access to a number of functions inside the expression: see below; * ``has_role``: Checks to see if the user has the given role - equivalent to an expression like ``'ROLE_ADMIN' in roles``. +* ``is_granted``: Similar to the php code like `$securityContext->isGranted('ROLE_USER')`. + Unlike `has_role` expression, `is_granted` will call your custom voters if defined. .. sidebar:: ``is_remember_me`` is different than checking ``IS_AUTHENTICATED_REMEMBERED`` pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy