-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Fixed problem with losing ROLE_PREVIOUS_ADMIN role. #8997
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
[Security] Fixed problem with losing ROLE_PREVIOUS_ADMIN role. #8997
Conversation
@schmittjoh could you review this one ? |
ping? |
Would be great to have this merged... |
@@ -107,6 +108,29 @@ public function supports(TokenInterface $token) | |||
} | |||
|
|||
/** | |||
* Retrives roles from user and appends SwitchUserRole if original token contained one. | |||
* | |||
* @param \Symfony\Component\Security\Core\User\UserInterface $user |
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.
remove the backslashes
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.
Actually, add a use statement for this interface and simply do @param UserInterface $user
here.
Ok, phpdocs fixed nad methd visibility changed to provate. |
👍 |
…le. (pawaclawczyk) This PR was squashed before being merged into the 2.3 branch (closes #8997). Discussion ---------- [Security] Fixed problem with losing ROLE_PREVIOUS_ADMIN role. <table> <tr> <td><b>Q</b></td> <td><b>A</b></td> </tr> <tr> <td>Bug fix?</td> <td>yes</td> </tr> <tr> <td>New feature</td> <td>no</td> </tr> <tr> <td>BC breaks?</td> <td>no</td> </tr> <tr> <td>Deprecations?</td> <td>no</td> </tr> <tr> <td>Tests pass?</td> <td>yes</td> </tr> <tr> <td>Fixed tickets</td> <td>#3085, #8974</td> </tr> <tr> <td>License</td> <td>MIT</td> </tr> <tr> <td>Doc PR</td> <td>n/a</td> </tr> </table> Problem occurs while user is impersonated. Authentication process generates new token and doeas not preserve role ```ROLE_PREVIOUS_ADMIN```. Ex. when parameter ```security.always_authenticate_before_granting``` is enabled. Commits ------- a7baa3b [Security] Fixed problem with losing ROLE_PREVIOUS_ADMIN role.
Problem occurs while user is impersonated. Authentication process generates new token and doeas not preserve role
ROLE_PREVIOUS_ADMIN
. Ex. when parametersecurity.always_authenticate_before_granting
is enabled.