Class PreAuthorizeAuthorizationManager
java.lang.Object
org.springframework.security.authorization.method.PreAuthorizeAuthorizationManager
- All Implemented Interfaces:
AuthorizationManager<org.aopalliance.intercept.MethodInvocation>
public final class PreAuthorizeAuthorizationManager
extends Object
implements AuthorizationManager<org.aopalliance.intercept.MethodInvocation>
An
AuthorizationManager which can determine if an Authentication may
invoke the MethodInvocation by evaluating an expression from the
PreAuthorize annotation.- Since:
- 5.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheck(Supplier<Authentication> authentication, org.aopalliance.intercept.MethodInvocation mi) Determine if anAuthenticationhas access to a method by evaluating an expression from thePreAuthorizeannotation that theMethodInvocationspecifies.voidsetExpressionHandler(MethodSecurityExpressionHandler expressionHandler) Sets theMethodSecurityExpressionHandler.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
-
PreAuthorizeAuthorizationManager
public PreAuthorizeAuthorizationManager()
-
-
Method Details
-
setExpressionHandler
Sets theMethodSecurityExpressionHandler.- Parameters:
expressionHandler- theMethodSecurityExpressionHandlerto use
-
check
public AuthorizationDecision check(Supplier<Authentication> authentication, org.aopalliance.intercept.MethodInvocation mi) Determine if anAuthenticationhas access to a method by evaluating an expression from thePreAuthorizeannotation that theMethodInvocationspecifies.- Specified by:
checkin interfaceAuthorizationManager<org.aopalliance.intercept.MethodInvocation>- Parameters:
authentication- theSupplierof theAuthenticationto checkmi- theMethodInvocationto check- Returns:
- an
AuthorizationDecisionornullif thePreAuthorizeannotation is not present
-