Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion security/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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())'
));

// ...
Expand Down Expand Up @@ -78,6 +78,11 @@ Additionally, you have access to a number of functions inside the expression:
equivalent to using the :ref:`isGranted() method <security-isgranted>`
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*
Expand Down