Skip to content

Commit 8fe7ae9

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Minor syntax issue [Security] Add deprecation information for is_anonymous
2 parents 4c21096 + 8f6defb commit 8fe7ae9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

security/expressions.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ accepts an :class:`Symfony\\Component\\ExpressionLanguage\\Expression` object::
2424
public function index(): Response
2525
{
2626
$this->denyAccessUnlessGranted(new Expression(
27-
'"ROLE_ADMIN" in role_names or (not is_anonymous() and user.isSuperAdmin())'
27+
'"ROLE_ADMIN" in role_names or (is_authenticated() and user.isSuperAdmin())'
2828
));
2929

3030
// ...
@@ -78,6 +78,10 @@ Additionally, you have access to a number of functions inside the expression:
7878
equivalent to using the :ref:`isGranted() method <security-isgranted>`
7979
from the security service.
8080

81+
.. deprecated:: 5.4
82+
83+
The ``is_anonymous()`` function is deprecated since Symfony 5.4.
84+
8185
.. sidebar:: ``is_remember_me()`` is different than checking ``IS_AUTHENTICATED_REMEMBERED``
8286

8387
The ``is_remember_me()`` and ``is_fully_authenticated()`` functions are *similar*

0 commit comments

Comments
 (0)