Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

rvanlaak
Copy link
Contributor

@rvanlaak rvanlaak commented Jun 5, 2015

... 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

@rvanlaak
Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

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
Copy link
Member

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).

Copy link
Contributor Author

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?

@rvanlaak
Copy link
Contributor Author

@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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is completed

@weaverryan
Copy link
Member

@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
@rvanlaak
Copy link
Contributor Author

Fixed it @weaverryan , but this PR should be merged first because right now on exit the user isn't fresh symfony/symfony#14931

@xabbuh
Copy link
Member

xabbuh commented Jun 23, 2015

👍

@weaverryan
Copy link
Member

I'm really happy to have this addition. Thanks so much Richard!

weaverryan added a commit that referenced this pull request Jun 28, 2015
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
@weaverryan weaverryan closed this Jun 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants