Skip to content

Commit 10965e0

Browse files
committed
Small optimization in AccessDecisionManager
1 parent c9b66a1 commit 10965e0

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Authorization/AccessDecisionManager.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ private function decideConsensus(TokenInterface $token, array $attributes, $obje
150150
{
151151
$grant = 0;
152152
$deny = 0;
153-
$abstain = 0;
154153
foreach ($this->voters as $voter) {
155154
$result = $voter->vote($token, $object, $attributes);
156155

@@ -163,11 +162,6 @@ private function decideConsensus(TokenInterface $token, array $attributes, $obje
163162
case VoterInterface::ACCESS_DENIED:
164163
++$deny;
165164

166-
break;
167-
168-
default:
169-
++$abstain;
170-
171165
break;
172166
}
173167
}
@@ -180,7 +174,7 @@ private function decideConsensus(TokenInterface $token, array $attributes, $obje
180174
return false;
181175
}
182176

183-
if ($grant == $deny && $grant != 0) {
177+
if ($grant > 0) {
184178
return $this->allowIfEqualGrantedDeniedDecisions;
185179
}
186180

0 commit comments

Comments
 (0)