Skip to content

Commit

Permalink
Merge branch '3.4' into 4.3
Browse files Browse the repository at this point in the history
* 3.4:
  Tweaked the explanation about the is_fully_authenticated() function
  • Loading branch information
javiereguiluz committed Sep 19, 2019
2 parents 9f3fcac + 6a5fa12 commit 1fd7412
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions security/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,24 @@ 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.
``is_granted``
``is_fully_authenticated()``
Equal to checking if the user has the ``IS_AUTHENTICATED_FULLY`` role.
``is_granted()``
Checks if the user has the given permission. Optionally accepts a second argument
with the object where permission is checked on. It's equivalent to using
the :doc:`isGranted() method </security/securing_services>` from the authorization
checker service.

.. 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 @@ -92,7 +92,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

0 comments on commit 1fd7412

Please sign in to comment.