Class AuthorizationManagers
java.lang.Object
org.springframework.security.authorization.AuthorizationManagers
A factory class to create an
AuthorizationManager
instances.- Since:
- 5.8
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> AuthorizationManager<T>
allOf
(AuthorizationDecision allAbstainDefaultDecision, AuthorizationManager<T>... managers) Creates anAuthorizationManager
that grants access if allAuthorizationManager
s granted, ifmanagers
are empty or abstained, a defaultAuthorizationDecision
is returned.static <T> AuthorizationManager<T>
allOf
(AuthorizationManager<T>... managers) Creates anAuthorizationManager
that grants access if allAuthorizationManager
s granted or abstained, ifmanagers
are empty then granted decision is returned.static <T> AuthorizationManager<T>
anyOf
(AuthorizationDecision allAbstainDefaultDecision, AuthorizationManager<T>... managers) Creates anAuthorizationManager
that grants access if at least oneAuthorizationManager
granted, ifmanagers
are empty or abstained, a defaultAuthorizationDecision
is returned.static <T> AuthorizationManager<T>
anyOf
(AuthorizationManager<T>... managers) Creates anAuthorizationManager
that grants access if at least oneAuthorizationManager
granted or abstained, ifmanagers
are empty then denied decision is returned.static <T> AuthorizationManager<T>
not
(AuthorizationManager<T> manager) Creates anAuthorizationManager
that reverses whatever decision the givenAuthorizationManager
granted.
-
Method Details
-
anyOf
Creates anAuthorizationManager
that grants access if at least oneAuthorizationManager
granted or abstained, ifmanagers
are empty then denied decision is returned.- Type Parameters:
T
- the type of object that is being authorized- Parameters:
managers
- theAuthorizationManager
s to use- Returns:
- the
AuthorizationManager
to use
-
anyOf
@SafeVarargs public static <T> AuthorizationManager<T> anyOf(AuthorizationDecision allAbstainDefaultDecision, AuthorizationManager<T>... managers) Creates anAuthorizationManager
that grants access if at least oneAuthorizationManager
granted, ifmanagers
are empty or abstained, a defaultAuthorizationDecision
is returned.- Type Parameters:
T
- the type of object that is being authorized- Parameters:
allAbstainDefaultDecision
- the default decision if allAuthorizationManager
s abstainedmanagers
- theAuthorizationManager
s to use- Returns:
- the
AuthorizationManager
to use - Since:
- 6.3
-
allOf
Creates anAuthorizationManager
that grants access if allAuthorizationManager
s granted or abstained, ifmanagers
are empty then granted decision is returned.- Type Parameters:
T
- the type of object that is being authorized- Parameters:
managers
- theAuthorizationManager
s to use- Returns:
- the
AuthorizationManager
to use
-
allOf
@SafeVarargs public static <T> AuthorizationManager<T> allOf(AuthorizationDecision allAbstainDefaultDecision, AuthorizationManager<T>... managers) Creates anAuthorizationManager
that grants access if allAuthorizationManager
s granted, ifmanagers
are empty or abstained, a defaultAuthorizationDecision
is returned.- Type Parameters:
T
- the type of object that is being authorized- Parameters:
allAbstainDefaultDecision
- the default decision if allAuthorizationManager
s abstainedmanagers
- theAuthorizationManager
s to use- Returns:
- the
AuthorizationManager
to use - Since:
- 6.3
-
not
Creates anAuthorizationManager
that reverses whatever decision the givenAuthorizationManager
granted. If the givenAuthorizationManager
abstains, then the returned manager also abstains.- Type Parameters:
T
- the type of object that is being authorized- Parameters:
manager
- theAuthorizationManager
to reverse- Returns:
- the reversing
AuthorizationManager
- Since:
- 6.3
-