Package org.springframework.security.authorization

# Class AuthorizationManagers

java.lang.Object
org.springframework.security.authorization.AuthorizationManagers

public final class AuthorizationManagers extends Object
A factory class to create an `AuthorizationManager` instances.

Since:
  5.8

## Method Summary

Modifier and Type
Method
Description
`static <T> AuthorizationManager<T>`
`allOf(AuthorizationDecision allAbstainDefaultDecision, AuthorizationManager<T>... managers)`
Creates an `AuthorizationManager` that grants access if all `AuthorizationManager`s granted, if `managers` are empty or abstained, a default `AuthorizationDecision` is returned.
`static <T> AuthorizationManager<T>`
`allOf(AuthorizationManager<T>... managers)`
Creates an `AuthorizationManager` that grants access if all `AuthorizationManager`s granted or abstained, if `managers` are empty then granted decision is returned.
`static <T> AuthorizationManager<T>`
`anyOf(AuthorizationDecision allAbstainDefaultDecision, AuthorizationManager<T>... managers)`
Creates an `AuthorizationManager` that grants access if at least one `AuthorizationManager` granted, if `managers` are empty or abstained, a default `AuthorizationDecision` is returned.
`static <T> AuthorizationManager<T>`
`anyOf(AuthorizationManager<T>... managers)`
Creates an `AuthorizationManager` that grants access if at least one `AuthorizationManager` granted or abstained, if `managers` are empty then denied decision is returned.
`static <T> AuthorizationManager<T>`
`not(AuthorizationManager<T> manager)`
Creates an `AuthorizationManager` that reverses whatever decision the given `AuthorizationManager` granted.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### anyOf

@SafeVarargs public static <T> AuthorizationManager<T> anyOf(AuthorizationManager<T>... managers)
Creates an `AuthorizationManager` that grants access if at least one `AuthorizationManager` granted or abstained, if `managers` are empty then denied decision is returned.

Type Parameters:
  `T` - the type of object that is being authorized
Parameters:
  `managers` - the `AuthorizationManager`s to use
Returns:
  the `AuthorizationManager` to use

### anyOf

@SafeVarargs public static <T> AuthorizationManager<T> anyOf(AuthorizationDecision allAbstainDefaultDecision, AuthorizationManager<T>... managers)
Creates an `AuthorizationManager` that grants access if at least one `AuthorizationManager` granted, if `managers` are empty or abstained, a default `AuthorizationDecision` is returned.

Type Parameters:
  `T` - the type of object that is being authorized
Parameters:
  `allAbstainDefaultDecision` - the default decision if all `AuthorizationManager`s abstained
  `managers` - the `AuthorizationManager`s to use
Returns:
  the `AuthorizationManager` to use
Since:
  6.3

### allOf

@SafeVarargs public static <T> AuthorizationManager<T> allOf(AuthorizationManager<T>... managers)
Creates an `AuthorizationManager` that grants access if all `AuthorizationManager`s granted or abstained, if `managers` are empty then granted decision is returned.

Type Parameters:
  `T` - the type of object that is being authorized
Parameters:
  `managers` - the `AuthorizationManager`s to use
Returns:
  the `AuthorizationManager` to use

### allOf

@SafeVarargs public static <T> AuthorizationManager<T> allOf(AuthorizationDecision allAbstainDefaultDecision, AuthorizationManager<T>... managers)
Creates an `AuthorizationManager` that grants access if all `AuthorizationManager`s granted, if `managers` are empty or abstained, a default `AuthorizationDecision` is returned.

Type Parameters:
  `T` - the type of object that is being authorized
Parameters:
  `allAbstainDefaultDecision` - the default decision if all `AuthorizationManager`s abstained
  `managers` - the `AuthorizationManager`s to use
Returns:
  the `AuthorizationManager` to use
Since:
  6.3

### not

public static <T> AuthorizationManager<T> not(AuthorizationManager<T> manager)
Creates an `AuthorizationManager` that reverses whatever decision the given `AuthorizationManager` granted. If the given `AuthorizationManager` abstains, then the returned manager also abstains.

Type Parameters:
  `T` - the type of object that is being authorized
Parameters:
  `manager` - the `AuthorizationManager` to reverse
Returns:
  the reversing `AuthorizationManager`
Since:
  6.3