Package org.springframework.security.authorization

# Class AuthorityReactiveAuthorizationManager<T>

java.lang.Object
org.springframework.security.authorization.AuthorityReactiveAuthorizationManager<T>

Type Parameters:
  `T` - the type of object being authorized

All Implemented Interfaces:
  `ReactiveAuthorizationManager<T>`

public class AuthorityReactiveAuthorizationManager<T> extends Object implements ReactiveAuthorizationManager<T>
A `ReactiveAuthorizationManager` that determines if the current user is authorized by evaluating if the `Authentication` contains a specified authority.

Since:
  5.0

## Method Summary

Modifier and Type
Method
Description
`reactor.core.publisher.Mono<AuthorizationDecision>`
`check(reactor.core.publisher.Mono<Authentication> authentication, T object)`
Determines if access is granted for a specific authentication and object.
`static <T> AuthorityReactiveAuthorizationManager<T>`
`hasAnyAuthority(String... authorities)`
Creates an instance of `AuthorityReactiveAuthorizationManager` with the provided authorities.
`static <T> AuthorityReactiveAuthorizationManager<T>`
`hasAnyRole(String... roles)`
Creates an instance of `AuthorityReactiveAuthorizationManager` with the provided authorities.
`static <T> AuthorityReactiveAuthorizationManager<T>`
`hasAuthority(String authority)`
Creates an instance of `AuthorityReactiveAuthorizationManager` with the provided authority.
`static <T> AuthorityReactiveAuthorizationManager<T>`
`hasRole(String role)`
Creates an instance of `AuthorityReactiveAuthorizationManager` with the provided authority.

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

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

### Methods inherited from interface org.springframework.security.authorization.ReactiveAuthorizationManager

`authorize, verify`

## Method Details

### check

public reactor.core.publisher.Mono<AuthorizationDecision> check(reactor.core.publisher.Mono<Authentication> authentication, T object)
Description copied from interface: `ReactiveAuthorizationManager`
Determines if access is granted for a specific authentication and object.

Specified by:
  `check` in interface `ReactiveAuthorizationManager<T>`
Parameters:
  `authentication` - the Authentication to check
  `object` - the object to check
Returns:
  an decision or empty Mono if no decision could be made.

### hasAuthority

public static <T> AuthorityReactiveAuthorizationManager<T> hasAuthority(String authority)
Creates an instance of `AuthorityReactiveAuthorizationManager` with the provided authority.

Type Parameters:
  `T` - the type of object being authorized
Parameters:
  `authority` - the authority to check for
Returns:
  the new instance

### hasAnyAuthority

public static <T> AuthorityReactiveAuthorizationManager<T> hasAnyAuthority(String... authorities)
Creates an instance of `AuthorityReactiveAuthorizationManager` with the provided authorities.

Type Parameters:
  `T` - the type of object being authorized
Parameters:
  `authorities` - the authorities to check for
Returns:
  the new instance

### hasRole

public static <T> AuthorityReactiveAuthorizationManager<T> hasRole(String role)
Creates an instance of `AuthorityReactiveAuthorizationManager` with the provided authority.

Type Parameters:
  `T` - the type of object being authorized
Parameters:
  `role` - the authority to check for prefixed with "ROLE_"
Returns:
  the new instance

### hasAnyRole

public static <T> AuthorityReactiveAuthorizationManager<T> hasAnyRole(String... roles)
Creates an instance of `AuthorityReactiveAuthorizationManager` with the provided authorities.

Type Parameters:
  `T` - the type of object being authorized
Parameters:
  `roles` - the authorities to check for prefixed with "ROLE_"
Returns:
  the new instance