Skip to content

Commit e18e809

Browse files
committed
Minor reword
1 parent 2e3a076 commit e18e809

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

security.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,8 @@ 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 in a controller::
914+
For role hierarchy to work, do not try to call ``$user->getRoles()`` manually.
915+
For example, in a controller extending from the :ref:`base controller <the-base-controller-class-services>`::
915916

916917
// BAD - $user->getRoles() will not know about the role hierarchy
917918
$hasAccess = in_array('ROLE_ADMIN', $user->getRoles());

0 commit comments

Comments
 (0)