8000 [#7060] Apply feedback by xabbuh · symfony/symfony-docs@f0db5af · GitHub
[go: up one dir, main page]

Skip to content

Commit f0db5af

Browse files
committed
[#7060] Apply feedback by xabbuh
1 parent b0a061f commit f0db5af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,8 @@ look like::
10151015
.. versionadded:: 3.2
10161016
The functionality to get the user via the method signature was introduced in
10171017
Symfony 3.2. You can still retrieve it by calling ``$this->getUser()`` if you
1018-
extend the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller`.
1018+
extend the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller`
1019+
class.
10191020

10201021
Now you can call whatever methods are on *your* User object. For example,
10211022
if your User object has a ``getFirstName()`` method, you could use that::
@@ -1046,7 +1047,6 @@ and being logged-in is optional, you can allow a null value for the argument::
10461047
// $user is null when not logged-in or anon.
10471048
}
10481049

1049-
10501050
The point is this: always check to see if the user is logged in before using
10511051
the User object, and use the ``isGranted`` method (or
10521052
:ref:`access_control <security-authorization-access-control>`) to do this::

0 commit comments

Comments
 (0)
0