diff --git a/best_practices/security.rst b/best_practices/security.rst
index a78f8327196..b959bb9df2e 100644
--- a/best_practices/security.rst
+++ b/best_practices/security.rst
@@ -121,7 +121,7 @@ Using ``@Security``, this looks like:
* Displays a form to create a new Post entity.
*
* @Route("/new", name="admin_post_new")
- * @Security("has_role('ROLE_ADMIN')")
+ * @Security("is_granted('ROLE_ADMIN')")
*/
public function new()
{
diff --git a/security.rst b/security.rst
index 40305a9b8cf..f39a77cad9e 100644
--- a/security.rst
+++ b/security.rst
@@ -892,7 +892,7 @@ using annotations::
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
/**
- * @Security("has_role('ROLE_ADMIN')")
+ * @Security("is_granted('ROLE_ADMIN')")
*/
public function hello($name)
{
diff --git a/security/access_control.rst b/security/access_control.rst
index 7c60ac7f8c1..c67cc78cc4d 100644
--- a/security/access_control.rst
+++ b/security/access_control.rst
@@ -265,7 +265,7 @@ key:
access_control:
-
path: ^/_internal/secure
- allow_if: "'127.0.0.1' == request.getClientIp() or has_role('ROLE_ADMIN')"
+ allow_if: "'127.0.0.1' == request.getClientIp() or is_granted('ROLE_ADMIN')"
.. code-block:: xml
@@ -279,7 +279,7 @@ key:
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: