Class AuthorizationManagerAfterMethodInterceptor
java.lang.Object
org.springframework.security.authorization.method.AuthorizationManagerAfterMethodInterceptor
- All Implemented Interfaces:
org.aopalliance.aop.Advice
,org.aopalliance.intercept.Interceptor
,org.aopalliance.intercept.MethodInterceptor
,org.springframework.aop.Advisor
,org.springframework.aop.framework.AopInfrastructureBean
,org.springframework.aop.PointcutAdvisor
,org.springframework.core.Ordered
public final class AuthorizationManagerAfterMethodInterceptor
extends Object
implements org.springframework.core.Ordered, org.aopalliance.intercept.MethodInterceptor, org.springframework.aop.PointcutAdvisor, org.springframework.aop.framework.AopInfrastructureBean
A
MethodInterceptor
which can determine if an Authentication
has access
to the result of an MethodInvocation
using an AuthorizationManager
- Since:
- 5.6
-
Field Summary
Fields inherited from interface org.springframework.aop.Advisor
EMPTY_ADVICE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionAuthorizationManagerAfterMethodInterceptor
(org.springframework.aop.Pointcut pointcut, AuthorizationManager<MethodInvocationResult> authorizationManager) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionorg.aopalliance.aop.Advice
int
getOrder()
org.springframework.aop.Pointcut
invoke
(org.aopalliance.intercept.MethodInvocation mi) boolean
Creates an interceptor for thePostAuthorize
annotationpostAuthorize
(PostAuthorizeAuthorizationManager authorizationManager) Creates an interceptor for thePostAuthorize
annotationvoid
setOrder
(int order)
-
Constructor Details
-
AuthorizationManagerAfterMethodInterceptor
public AuthorizationManagerAfterMethodInterceptor(org.springframework.aop.Pointcut pointcut, AuthorizationManager<MethodInvocationResult> authorizationManager) Creates an instance.- Parameters:
pointcut
- thePointcut
to useauthorizationManager
- theAuthorizationManager
to use
-
-
Method Details
-
postAuthorize
Creates an interceptor for thePostAuthorize
annotation- Returns:
- the interceptor
-
postAuthorize
public static AuthorizationManagerAfterMethodInterceptor postAuthorize(PostAuthorizeAuthorizationManager authorizationManager) Creates an interceptor for thePostAuthorize
annotation- Parameters:
authorizationManager
- thePostAuthorizeAuthorizationManager
to use- Returns:
- the interceptor
-
invoke
- Specified by:
invoke
in interfaceorg.aopalliance.intercept.MethodInterceptor
- Parameters:
mi
- theMethodInvocation
to check- Throws:
AccessDeniedException
- if access is not grantedThrowable
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
setOrder
public void setOrder(int order) -
getPointcut
public org.springframework.aop.Pointcut getPointcut()- Specified by:
getPointcut
in interfaceorg.springframework.aop.PointcutAdvisor
-
getAdvice
public org.aopalliance.aop.Advice getAdvice()- Specified by:
getAdvice
in interfaceorg.springframework.aop.Advisor
-
isPerInstance
public boolean isPerInstance()- Specified by:
isPerInstance
in interfaceorg.springframework.aop.Advisor
-