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

PUGX UserProviders to fix supportsClass return value in FOS UserProviders #119

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

christoph-pflueger
Copy link

@christoph-pflueger christoph-pflueger commented Sep 11, 2016

Currently, switching back from an impersonated user to ones original account does not work. That's due to the fact that the FOSUserBundle compares the original account's class to the impersonated user's class in its own UserProvider when refreshing a user.

Example

Assuming you have two user types UserBundle\Entity\UserOne and UserBundle\Entity\UserTwo. When impersonating another UserOne with a UserOne account, everything works as expected. However, when impersonating a UserTwo with a UserOne account, the comparison backfires.

Propsed fix

Add custom PUGX UserProviders that extend the FOS UserProviders and override the existing supportsClass functions. By comparing the parent class of both users, everything works as expected.

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

Successfully merging this pull request may close these issues.

1 participant