Class RequiredAuthoritiesAuthorizationManager<T>
java.lang.Object
org.springframework.security.authorization.RequiredAuthoritiesAuthorizationManager<T>
- Type Parameters:
T- the type
- All Implemented Interfaces:
AuthorizationManager<T>
public class RequiredAuthoritiesAuthorizationManager<T>
extends Object
implements AuthorizationManager<T>
An
AuthorizationManager that requires all the authorities returned by a
RequiredAuthoritiesRepository implementation.- Since:
- 7.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance. -
Method Summary
Modifier and TypeMethodDescription@Nullable AuthorizationResultauthorize(Supplier<? extends @Nullable Authentication> authentication, T object) Determines if access is granted for a specific authentication and object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.authorization.AuthorizationManager
verify
-
Constructor Details
-
RequiredAuthoritiesAuthorizationManager
Creates a new instance.- Parameters:
authorities- theRequiredAuthoritiesRepositoryto use. Cannot be null.
-
-
Method Details
-
authorize
public @Nullable AuthorizationResult authorize(Supplier<? extends @Nullable Authentication> authentication, T object) Description copied from interface:AuthorizationManagerDetermines if access is granted for a specific authentication and object.- Specified by:
authorizein interfaceAuthorizationManager<T>- Parameters:
authentication- theSupplierof theAuthenticationto authorizeobject- theAuthorizationManagerobject to authorize- Returns:
- an
AuthorizationResult
-