-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Document security.switch_user event #5361
Conversation
ping @weaverryan |
completed. The ``SwitchUserEvent`` is passed to the listener, based on which you are able | ||
to get the target user you impersonate. | ||
|
||
The cookbook article about :ref:`Making the Locale "Sticky" during a User's Session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to use the doc
role here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xabbuh fixed it 👍
to get the target user you impersonate. | ||
|
||
The cookbook article about :doc:`Making the Locale "Sticky" during a User's Session | ||
<cookbook/session/locale_sticky_session>` does not take any changing locale into account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need the leading slash for the document name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, can you please move the doc
role on its own line instead of splitting it across two lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
------ | ||
|
||
The firewall dispatches the ``security.switch_user`` event right after the impersonation | ||
completed. The ``SwitchUserEvent`` is passed to the listener, based on which you are able |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a good idea to refer to the API docs for the SwitchUserEvent
(using the class
role).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, will look for an example in another article. Do you have a page where all available roles are documented?
@xabbuh revised the documentation based on your comments 👍 |
------ | ||
|
||
The firewall dispatches the ``security.switch_user`` event right after the impersonation | ||
completed. The :class:`Symfony\\Component\\Security\\Http\\Event\\SwitchUserEvent` is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is completed
@rvanlaak I just left a few comments - but if you can make those changes, then a big 👍 from me! Thanks! |
... in the cookbook article about How to Impersonate a User. Added code sample about how to change the locale in case of a sticky locale: http://symfony.com/doc/current/cookbook/session/locale_sticky_session.html
Fixed it @weaverryan , but this PR should be merged first because right now on exit the user isn't fresh symfony/symfony#14931 |
👍 |
I'm really happy to have this addition. Thanks so much Richard! |
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #5361). Discussion ---------- Document security.switch_user event ... in the cookbook article about How to Impersonate a User. Added code sample about how to change the locale in case of a sticky locale: http://symfony.com/doc/current/cookbook/session/locale_sticky_session.html | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3+ | Fixed tickets | symfony/symfony#14874 Commits ------- 2f81cdd Document security.switch_user event
... in the cookbook article about How to Impersonate a User.
Added code sample about how to change the locale in case of a sticky locale:
http://symfony.com/doc/current/cookbook/session/locale_sticky_session.html