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 anAuthorizationManagerthat grants access if allAuthorizationManagers granted, ifmanagersare empty or abstained, a defaultAuthorizationDecisionis returned.static <T> AuthorizationManager<T>allOf(AuthorizationManager<T>... managers) Creates anAuthorizationManagerthat grants access if allAuthorizationManagers granted or abstained, ifmanagersare empty then granted decision is returned.static <T> AuthorizationManager<T>anyOf(AuthorizationDecision allAbstainDefaultDecision, AuthorizationManager<T>... managers) Creates anAuthorizationManagerthat grants access if at least oneAuthorizationManagergranted, ifmanagersare empty or abstained, a defaultAuthorizationDecisionis returned.static <T> AuthorizationManager<T>anyOf(AuthorizationManager<T>... managers) Creates anAuthorizationManagerthat grants access if at least oneAuthorizationManagergranted or abstained, ifmanagersare empty then denied decision is returned.static <T> AuthorizationManager<T>not(AuthorizationManager<T> manager) Creates anAuthorizationManagerthat reverses whatever decision the givenAuthorizationManagergranted.
-
Method Details
-
anyOf
Creates anAuthorizationManagerthat grants access if at least oneAuthorizationManagergranted or abstained, ifmanagersare empty then denied decision is returned.- Type Parameters:
T- the type of object that is being authorized- Parameters:
managers- theAuthorizationManagers to use- Returns:
- the
AuthorizationManagerto use
-
anyOf
@SafeVarargs public static <T> AuthorizationManager<T> anyOf(AuthorizationDecision allAbstainDefaultDecision, AuthorizationManager<T>... managers) Creates anAuthorizationManagerthat grants access if at least oneAuthorizationManagergranted, ifmanagersare empty or abstained, a defaultAuthorizationDecisionis returned.- Type Parameters:
T- the type of object that is being authorized- Parameters:
allAbstainDefaultDecision- the default decision if allAuthorizationManagers abstainedmanagers- theAuthorizationManagers to use- Returns:
- the
AuthorizationManagerto use - Since:
- 6.3
-
allOf
Creates anAuthorizationManagerthat grants access if allAuthorizationManagers granted or abstained, ifmanagersare empty then granted decision is returned.- Type Parameters:
T- the type of object that is being authorized- Parameters:
managers- theAuthorizationManagers to use- Returns:
- the
AuthorizationManagerto use
-
allOf
@SafeVarargs public static <T> AuthorizationManager<T> allOf(AuthorizationDecision allAbstainDefaultDecision, AuthorizationManager<T>... managers) Creates anAuthorizationManagerthat grants access if allAuthorizationManagers granted, ifmanagersare empty or abstained, a defaultAuthorizationDecisionis returned.- Type Parameters:
T- the type of object that is being authorized- Parameters:
allAbstainDefaultDecision- the default decision if allAuthorizationManagers abstainedmanagers- theAuthorizationManagers to use- Returns:
- the
AuthorizationManagerto use - Since:
- 6.3
-
not
Creates anAuthorizationManagerthat reverses whatever decision the givenAuthorizationManagergranted. If the givenAuthorizationManagerabstains, then the returned manager also abstains.- Type Parameters:
T- the type of object that is being authorized- Parameters:
manager- theAuthorizationManagerto reverse- Returns:
- the reversing
AuthorizationManager - Since:
- 6.3
-