Skip to content

Commit 9ef80d0

Browse files
committed
minor #19448 [Security] Reword impersonnating event description (alamirault)
This PR was merged into the 5.4 branch. Discussion ---------- [Security] Reword impersonnating event description Try fix #19446 - Replace `right after the impersonation is completed` by `Just before the impersonation is fully completed,` - Link to event dispatcher (common on other pages) - SwitchUserEvent is also dispatched when we exit impersonntion Commits ------- 541a016 Reword impersonnating event description
2 parents 5a98c4a + 541a016 commit 9ef80d0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

security/impersonating_user.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,14 @@ not this is allowed. If your voter isn't called, see :ref:`declaring-the-voter-a
363363
Events
364364
------
365365

366-
The firewall dispatches the ``security.switch_user`` event right after the impersonation
367-
is completed. The :class:`Symfony\\Component\\Security\\Http\\Event\\SwitchUserEvent` is
368-
passed to the listener, and you can use this to get the user that you are now impersonating.
366+
Just before the impersonation is fully completed, the ``security.switch_user`` event is
367+
dispatched.
368+
The :class:`Symfony\\Component\\Security\\Http\\Event\\SwitchUserEvent` is
369+
passed to the :doc:`listener or subscriber </event_dispatcher>`, and you can use
370+
this to get the user that you are now impersonating.
371+
372+
This event is also dispatched just before impersonation is fully exited. You can
373+
use it to get the original impersonator user.
369374

370375
The :ref:`locale-sticky-session` section does not update the locale when you
371376
impersonate a user. If you *do* want to be sure to update the locale when you

0 commit comments

Comments
 (0)