Skip to content

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