Skip to content

Commit 2e3a076

Browse files
committed
minor symfony#10878 Minor update (ThomasLandauer)
This PR was submitted for the 4.1 branch but it was merged into the 4.2 branch instead (closes symfony#10878). Discussion ---------- Minor update Added note to indicate that `$this->isGranted()` only works in a controller, not in an Authenticator. Commits ------- 63f5d66 Minor update
2 parents a5e77cd + 63f5d66 commit 2e3a076

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

security.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ Users with the ``ROLE_ADMIN`` role will also have the
911911
``ROLE_USER`` role. And users with ``ROLE_SUPER_ADMIN``, will automatically have
912912
``ROLE_ADMIN``, ``ROLE_ALLOWED_TO_SWITCH`` and ``ROLE_USER`` (inherited from ``ROLE_ADMIN``).
913913

914-
For role hierarchy to work, do not try to call ``$user->getRoles()`` manually::
914+
For role hierarchy to work, do not try to call ``$user->getRoles()`` manually in a controller::
915915

916916
// BAD - $user->getRoles() will not know about the role hierarchy
917917
$hasAccess = in_array('ROLE_ADMIN', $user->getRoles());
@@ -927,8 +927,8 @@ For role hierarchy to work, do not try to call ``$user->getRoles()`` manually::
927927
:doc:`security voter </security/voters>` that looks for the user roles
928928
in the database.
929929

930-
Checking for Security Vulnerabilities in your Dependences
931-
---------------------------------------------------------
930+
Checking for Security Vulnerabilities in your Dependencies
931+
----------------------------------------------------------
932932

933933
See :doc:`/security/security_checker`.
934934

0 commit comments

Comments
 (0)