8000 [Security] Fix user role restriction. by gorshkov-ag · Pull Request #35533 · symfony/symfony · GitHub
[go: up one dir, main page]

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
Next Next commit
Allowed to restrict user roles.
It was impossible to restrict user roles on the fly without deauthentication.
  • Loading branch information
gorshkov-ag authored Jan 31, 2020
commit 4cf925b1385abcb9d0368932d6a176b1e763bf23
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ private function hasUserChanged(UserInterface $user): bool
$userRoles[] = 'ROLE_PREVIOUS_ADMIN';
}

if (\count($userRoles) !== \count($this->getRoleNames()) || \count($userRoles) !== \count(array_intersect($userRoles, $this->getRoleNames()))) {
if (\count($userRoles) !== \count($this->getRoleNames()) && \count($this->getRoleNames()) !== \count(array_intersect($this->getRoleNames(), $userRoles))) {
return true;
}

Expand Down
0