Small optimization in AccessDecisionManager
This commit is contained in:
parent
96e211d2da
commit
0e934637df
@ -150,7 +150,6 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
|
||||
{
|
||||
$grant = 0;
|
||||
$deny = 0;
|
||||
$abstain = 0;
|
||||
foreach ($this->voters as $voter) {
|
||||
$result = $voter->vote($token, $object, $attributes);
|
||||
|
||||
@ -163,11 +162,6 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
|
||||
case VoterInterface::ACCESS_DENIED:
|
||||
++$deny;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
++$abstain;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -180,7 +174,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($grant == $deny && $grant != 0) {
|
||||
if ($grant > 0) {
|
||||
return $this->allowIfEqualGrantedDeniedDecisions;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user