Skip to content

[DX] Switch user from the WDT #14458

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

Closed
wants to merge 1 commit into from
Closed

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Apr 23, 2015

Before going further, I would like to get your opinion on this feature.

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

When working with user permissions, it's very convenient to switch between roles and the impersonating feature of Symfony is really useful for that.

http://symfony.com/doc/current/cookbook/security/impersonating_user.html

Input field to choose the user to impersonate
switch_user

Link to quit and return to the previous user
switch_user_exit

TODO LIST:

  • Support customized URL parameter (_switch_user)
  • Check roles with isGranted instead of looking at the list of roles
  • Support customized role (ROLE_ALLOWED_TO_SWITCH)

Add a link to switch back
@GromNaN GromNaN changed the title [DX] Add an input to switch user from the WDT [DX] Switch user from the WDT Apr 23, 2015
<b>Switch to user</b>
<a href="?_switch_user=_exit" title="Switch back">Exit</a>
</div>
{% elseif 'ROLE_ALLOWED_TO_SWITCH' in collector.roles %}
Copy link
Contributor

Choose a reason for hiding this comment

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

it won't work when the role is modified

# app/config/security.yml
security:
    firewalls:
        main:
            switch_user: { role: ROLE_ADMIN }

Copy link
Member Author

Choose a reason for hiding this comment

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

Exact. Added to the todo list. That goes with the customization of the request parameter.

@GromNaN
Copy link
Member Author

GromNaN commented Jul 15, 2015

I close this PR as it is too complex to handle configurable roles and query parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants