File tree 2 files changed +3
-6
lines changed
src/Symfony/Component/Security/Core
Tests/Authentication/Token
2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -317,13 +317,10 @@ private function hasUserChanged(UserInterface $user): bool
317
317
return true ;
318
318
}
319
319
320
+ $ currentUserRoles = array_map ('strval ' , (array ) $ this ->user ->getRoles ());
320
321
$ userRoles = array_map ('strval ' , (array ) $ user ->getRoles ());
321
322
322
- if ($ this instanceof SwitchUserToken) {
323
- $ userRoles [] = 'ROLE_PREVIOUS_ADMIN ' ;
324
- }
325
-
326
- if (\count ($ userRoles ) !== \count ($ this ->getRoleNames ()) || \count ($ userRoles ) !== \count (array_intersect ($ userRoles , $ this ->getRoleNames ()))) {
323
+ if (\count ($ userRoles ) !== \count ($ currentUserRoles ) || \count ($ userRoles ) !== \count (array_intersect ($ userRoles , $ currentUserRoles ))) {
327
324
return true ;
328
325
}
329
326
Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ public function getUserChangesAdvancedUser()
238
238
*/
239
239
public function testSetUserDoesNotSetAuthenticatedToFalseWhenUserDoesNotChange ($ user )
240
240
{
241
- $ token = new ConcreteToken ();
241
+ $ token = new ConcreteToken ([ ' ROLE_FOO ' ] );
242
242
$ token ->setAuthenticated (true );
243
243
$ this ->assertTrue ($ token ->isAuthenticated ());
244
244
You can’t perform that action at this time.
0 commit comments