Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 1d6379b

Browse files
committed
[Security] Fix defining multiple roles per access_control rule
1 parent 526ae0a commit 1d6379b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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)