Class SecuredAuthorizationManager
java.lang.Object
org.springframework.security.authorization.method.SecuredAuthorizationManager
- All Implemented Interfaces:
AuthorizationManager<org.aopalliance.intercept.MethodInvocation>
public final class SecuredAuthorizationManager
extends Object
implements AuthorizationManager<org.aopalliance.intercept.MethodInvocation>
An
AuthorizationManager which can determine if an Authentication may
invoke the MethodInvocation by evaluating if the Authentication
contains a specified authority from the Spring Security's Secured annotation.- Since:
- 5.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable AuthorizationResultauthorize(Supplier<? extends @Nullable Authentication> authentication, org.aopalliance.intercept.MethodInvocation mi) Determines if access is granted for a specific authentication and object.voidsetAuthoritiesAuthorizationManager(AuthorizationManager<Collection<String>> authoritiesAuthorizationManager) Sets anAuthorizationManagerthat accepts a collection of authority strings.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
-
SecuredAuthorizationManager
public SecuredAuthorizationManager()
-
-
Method Details
-
setAuthoritiesAuthorizationManager
public void setAuthoritiesAuthorizationManager(AuthorizationManager<Collection<String>> authoritiesAuthorizationManager) Sets anAuthorizationManagerthat accepts a collection of authority strings.- Parameters:
authoritiesAuthorizationManager- theAuthorizationManagerthat accepts a collection of authority strings to use- Since:
- 6.1
-
authorize
public @Nullable AuthorizationResult authorize(Supplier<? extends @Nullable Authentication> authentication, org.aopalliance.intercept.MethodInvocation mi) Description copied from interface:AuthorizationManagerDetermines if access is granted for a specific authentication and object.- Specified by:
authorizein interfaceAuthorizationManager<org.aopalliance.intercept.MethodInvocation>- Parameters:
authentication- theSupplierof theAuthenticationto authorizemi- theAuthorizationManagerobject to authorize- Returns:
- an
AuthorizationResult
-