Skip to content

[Security] Added documentation for IS_AUTHENTICATED #17226

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
Aug 31, 2022
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
8 changes: 4 additions & 4 deletions security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2418,19 +2418,19 @@ Secondly, you can use a special "attribute" in place of a role::

public function adminDashboard(): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
$this->denyAccessUnlessGranted('IS_AUTHENTICATED');

// ...
}

You can use ``IS_AUTHENTICATED_FULLY`` anywhere roles are used: like
You can use ``IS_AUTHENTICATED`` anywhere roles are used: like
``access_control`` or in Twig.

``IS_AUTHENTICATED_FULLY`` isn't a role, but it kind of acts like one, and every
``IS_AUTHENTICATED`` isn't a role, but it kind of acts like one, and every
user that has logged in will have this. Actually, there are some special attributes
like this:

* ``IS_AUTHENTICATED_REMEMBERED``: *All* logged in users have this, even
* ``IS_AUTHENTICATED_REMEMBERED``: Just like ``IS_AUTHENTICATED``, *all* logged in users have this, even
if they are logged in because of a "remember me cookie". Even if you don't
use the :doc:`remember me functionality </security/remember_me>`,
you can use this to check if the user is logged in.
Expand Down