8000 [Security] Fix defining multiple roles per access_control rule by chalasr · Pull Request #34304 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Security] Fix defining multiple roles per access_control rule #34304

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

Merged
merged 1 commit into from
Nov 9, 2019
Merged
Changes from all commits
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
[Security] Fix defining multiple roles per access_control rule
  • Loading branch information
chalasr committed Nov 9, 2019
commit 338b3dfd9f202c3c7af0f0d417365f64c317f057
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ public function __invoke(RequestEvent $event)
$this->tokenStorage->setToken($token);
}

if (!$this->accessDecisionManager->decide($token, $attributes, $request)) {
$granted = false;
foreach ($attributes as $key => $value) {
if ($this->accessDecisionManager->decide($token, [$key => $value], $request)) {
$granted = true;
}
}

if (!$granted) {
$exception = new AccessDeniedException();
$exception->setAttributes($attributes);
$exception->setSubject($request);
Expand Down
0