From 0c121a1532aac285b58ba2466cefa83e749ec127 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 6 Sep 2019 12:40:33 +0200 Subject: [PATCH] Tweaked the explanation about the is_fully_authenticated() function --- security/expressions.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/security/expressions.rst b/security/expressions.rst index 40aa4109624..82a2aebee31 100644 --- a/security/expressions.rst +++ b/security/expressions.rst @@ -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`` @@ -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).