Class MethodExpressionAuthorizationManager
- java.lang.Object
-
- org.springframework.security.authorization.method.MethodExpressionAuthorizationManager
-
- All Implemented Interfaces:
AuthorizationManager<org.aopalliance.intercept.MethodInvocation>
public final class MethodExpressionAuthorizationManager extends java.lang.Object implements AuthorizationManager<org.aopalliance.intercept.MethodInvocation>
An expression-basedAuthorizationManagerthat determines the access by evaluating the provided expression against theMethodInvocation.- Since:
- 5.8
-
-
Constructor Summary
Constructors Constructor Description MethodExpressionAuthorizationManager(java.lang.String expressionString)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorizationDecisioncheck(java.util.function.Supplier<Authentication> authentication, org.aopalliance.intercept.MethodInvocation context)Determines the access by evaluating the provided expression.voidsetExpressionHandler(SecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation> expressionHandler)Sets theSecurityExpressionHandlerto be used.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.springframework.security.authorization.AuthorizationManager
verify
-
-
-
-
Method Detail
-
setExpressionHandler
public void setExpressionHandler(SecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation> expressionHandler)
Sets theSecurityExpressionHandlerto be used. The default isDefaultMethodSecurityExpressionHandler.- Parameters:
expressionHandler- theSecurityExpressionHandlerto use
-
check
public AuthorizationDecision check(java.util.function.Supplier<Authentication> authentication, org.aopalliance.intercept.MethodInvocation context)
Determines the access by evaluating the provided expression.- Specified by:
checkin interfaceAuthorizationManager<org.aopalliance.intercept.MethodInvocation>- Parameters:
authentication- theSupplierof theAuthenticationto checkcontext- theMethodInvocationto check- Returns:
- an
ExpressionAuthorizationDecisionbased on the evaluated expression
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-