Class PreAuthorizeAuthorizationManager
- java.lang.Object
-
- org.springframework.security.authorization.method.PreAuthorizeAuthorizationManager
-
- All Implemented Interfaces:
AuthorizationManager<org.aopalliance.intercept.MethodInvocation>
public final class PreAuthorizeAuthorizationManager extends java.lang.Object implements AuthorizationManager<org.aopalliance.intercept.MethodInvocation>
AnAuthorizationManager
which can determine if anAuthentication
may invoke theMethodInvocation
by evaluating an expression from thePreAuthorize
annotation.- Since:
- 5.6
-
-
Constructor Summary
Constructors Constructor Description PreAuthorizeAuthorizationManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorizationDecision
check(java.util.function.Supplier<Authentication> authentication, org.aopalliance.intercept.MethodInvocation mi)
Determine if anAuthentication
has access to a method by evaluating an expression from thePreAuthorize
annotation that theMethodInvocation
specifies.void
setExpressionHandler(MethodSecurityExpressionHandler expressionHandler)
Sets theMethodSecurityExpressionHandler
.-
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.AuthorizationManager
verify
-
-
-
-
Method Detail
-
setExpressionHandler
public void setExpressionHandler(MethodSecurityExpressionHandler expressionHandler)
Sets theMethodSecurityExpressionHandler
.- Parameters:
expressionHandler
- theMethodSecurityExpressionHandler
to use
-
check
public AuthorizationDecision check(java.util.function.Supplier<Authentication> authentication, org.aopalliance.intercept.MethodInvocation mi)
Determine if anAuthentication
has access to a method by evaluating an expression from thePreAuthorize
annotation that theMethodInvocation
specifies.- Specified by:
check
in interfaceAuthorizationManager<org.aopalliance.intercept.MethodInvocation>
- Parameters:
authentication
- theSupplier
of theAuthentication
to checkmi
- theMethodInvocation
to check- Returns:
- an
AuthorizationDecision
ornull
if thePreAuthorize
annotation is not present
-
-