|
|
|
|
@ -41,11 +41,17 @@ public final class AuthorizationManagers {
@@ -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 {
@@ -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); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|