8000 [Security] Fix defining multiple roles per access_control rule · symfony/symfony@338b3df · GitHub
[go: up one dir, main page]

Skip to content

Commit 338b3df

Browse files
committed
[Security] Fix defining multiple roles per access_control rule
1 parent fd7c676 commit 338b3df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Symfony/Component/Security/Http/Firewall/AccessListener.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,14 @@ public function __invoke(RequestEvent $event)
6868
$this->tokenStorage->setToken($token);
6969
}
7070

71-
if (!$this->accessDecisionManager->decide($token, $attributes, $request)) {
71+
$granted = false;
72+
foreach ($attributes as $key => $value) {
73+
if ($this->accessDecisionManager->decide($token, [$key => $value], $request)) {
74+
$granted = true;
75+
}
76+
}
77+
78+
if (!$granted) {
7279
$exception = new AccessDeniedException();
7380
$exception->setAttributes($attributes);
7481
$exception->setSubject($request);

0 commit comments

Comments
 (0)
0