Fix allOf/anyOf Abstain Logic
Closes gh-13069
This commit is contained in:
@@ -41,11 +41,17 @@ public final class AuthorizationManagers {
|
||||
List<AuthorizationDecision> decisions = new ArrayList<>();
|
||||
for (AuthorizationManager<T> manager : managers) {
|
||||
AuthorizationDecision decision = manager.check(authentication, object);
|
||||
if (decision == null || decision.isGranted()) {
|
||||
if (decision == null) {
|
||||
continue;
|
||||
}
|
||||
if (decision.isGranted()) {
|
||||
return decision;
|
||||
}
|
||||
decisions.add(decision);
|
||||
}
|
||||
if (decisions.isEmpty()) {
|
||||
return new AuthorizationDecision(false);
|
||||
}
|
||||
return new CompositeAuthorizationDecision(false, decisions);
|
||||
};
|
||||
}
|
||||
@@ -64,11 +70,17 @@ public final class AuthorizationManagers {
|
||||
List<AuthorizationDecision> decisions = new ArrayList<>();
|
||||
for (AuthorizationManager<T> manager : managers) {
|
||||
AuthorizationDecision decision = manager.check(authentication, object);
|
||||
if (decision != null && !decision.isGranted()) {
|
||||
if (decision == null) {
|
||||
continue;
|
||||
}
|
||||
if (!decision.isGranted()) {
|
||||
return decision;
|
||||
}
|
||||
decisions.add(decision);
|
||||
}
|
||||
if (decisions.isEmpty()) {
|
||||
return new AuthorizationDecision(true);
|
||||
}
|
||||
return new CompositeAuthorizationDecision(true, decisions);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user