From 12fcb6a34d9ef22b09f421e19d4871e81bd04149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Schl=C3=BCter?= Date: Sat, 8 Jan 2022 17:41:23 +0100 Subject: [PATCH] [Security] Add deprecation information for is_anonymous --- security/expressions.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/security/expressions.rst b/security/expressions.rst index c1bc9717a70..88bebd5dc07 100644 --- a/security/expressions.rst +++ b/security/expressions.rst @@ -24,7 +24,7 @@ accepts an :class:`Symfony\\Component\\ExpressionLanguage\\Expression` object:: public function index(): Response { $this->denyAccessUnlessGranted(new Expression( - '"ROLE_ADMIN" in role_names or (not is_anonymous() and user.isSuperAdmin())' + '"ROLE_ADMIN" in role_names or (is_authenticated() and user.isSuperAdmin())' )); // ... @@ -78,6 +78,11 @@ Additionally, you have access to a number of functions inside the expression: equivalent to using the :ref:`isGranted() method ` from the security service. +.. deprecated:: 5.4 + + The ``is_anonymous()`` function is + deprecated since Symfony 5.4. + .. sidebar:: ``is_remember_me()`` is different than checking ``IS_AUTHENTICATED_REMEMBERED`` The ``is_remember_me()`` and ``is_fully_authenticated()`` functions are *similar*