Skip to content

[Security] Fix user role restriction. #35533

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 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update user roles comparison.
  • Loading branch information
gorshkov-ag committed Feb 13, 2020
commit 429dee7efb5d018a67d0654bfbc956cb08d1b86c
4 changes: 2 additions & 2 deletions src/Symfony/Component/Security/Core/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ public function isEqualTo(UserInterface $user): bool

$currentRoles = array_map('strval', (array) $this->getRoles());
$newRoles = array_map('strval', (array) $user->getRoles());
$rolesChanged = \count($currentRoles) !== \count($newRoles) || \count($currentRoles) !== \count(array_intersect($currentRoles, $newRoles));
if ($rolesChanged) {

if (\count($newRoles) !== \count(array_intersect($newRoles, $currentRoles))) {
return false;
}

Expand Down