Skip to content

Tweaked the explanation about the is_fully_authenticated() function #12280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2019
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
16 changes: 8 additions & 8 deletions security/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ Inside the expression, you have access to a number of variables:

Additionally, you have access to a number of functions inside the expression:

``is_authenticated``
``is_authenticated()``
Returns ``true`` if the user is authenticated via "remember-me" or authenticated
"fully" - i.e. returns true if the user is "logged in".
``is_anonymous``
``is_anonymous()``
Returns ``true`` if the user is anonymous. That is, the firewall confirms that it
does not know this user's identity. This is different from ``IS_AUTHENTICATED_ANONYMOUSLY``,
which is granted to *all* users, including authenticated ones.
``is_remember_me``
``is_remember_me()``
Similar, but not equal to ``IS_AUTHENTICATED_REMEMBERED``, see below.
``is_fully_authenticated``
Similar, but not equal to ``IS_AUTHENTICATED_FULLY``, see below.
``has_role``
``is_fully_authenticated()``
Equal to checking if the user has the ``IS_AUTHENTICATED_FULLY`` role.
``has_role()``
Checks to see if the user has the given role - equivalent to an expression like
``'ROLE_ADMIN' in roles``.

.. sidebar:: ``is_remember_me`` is different than checking ``IS_AUTHENTICATED_REMEMBERED``
.. sidebar:: ``is_remember_me()`` is different than checking ``IS_AUTHENTICATED_REMEMBERED``

The ``is_remember_me()`` and ``is_fully_authenticated()`` functions are *similar*
to using ``IS_AUTHENTICATED_REMEMBERED`` and ``IS_AUTHENTICATED_FULLY``
Expand All @@ -87,7 +87,7 @@ Additionally, you have access to a number of functions inside the expression:
Here, ``$access1`` and ``$access2`` will be the same value. Unlike the
behavior of ``IS_AUTHENTICATED_REMEMBERED`` and ``IS_AUTHENTICATED_FULLY``,
the ``is_remember_me()`` function *only* returns true if the user is authenticated
via a remember-me cookie and ``is_fully_authenticated`` *only* returns
via a remember-me cookie and ``is_fully_authenticated()`` *only* returns
true if the user has actually logged in during this session (i.e. is
full-fledged).

Expand Down