Class AuthorizationManagerBeforeMethodInterceptor
- java.lang.Object
-
- org.springframework.security.authorization.method.AuthorizationManagerBeforeMethodInterceptor
-
- 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 AuthorizationManagerBeforeMethodInterceptor extends java.lang.Object implements org.springframework.core.Ordered, org.aopalliance.intercept.MethodInterceptor, org.springframework.aop.PointcutAdvisor, org.springframework.aop.framework.AopInfrastructureBeanAMethodInterceptorwhich uses aAuthorizationManagerto determine if anAuthenticationmay invoke the givenMethodInvocation- Since:
- 5.6
-
-
Constructor Summary
Constructors Constructor Description AuthorizationManagerBeforeMethodInterceptor(org.springframework.aop.Pointcut pointcut, AuthorizationManager<org.aopalliance.intercept.MethodInvocation> authorizationManager)Creates an instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.aopalliance.aop.AdvicegetAdvice()intgetOrder()org.springframework.aop.PointcutgetPointcut()java.lang.Objectinvoke(org.aopalliance.intercept.MethodInvocation mi)Determine if anAuthenticationhas access to theMethodInvocationusing the configuredAuthorizationManager.booleanisPerInstance()static AuthorizationManagerBeforeMethodInterceptorjsr250()Creates an interceptor for the JSR-250 annotationsstatic AuthorizationManagerBeforeMethodInterceptorjsr250(Jsr250AuthorizationManager authorizationManager)Creates an interceptor for the JSR-250 annotationsstatic AuthorizationManagerBeforeMethodInterceptorpreAuthorize()Creates an interceptor for thePreAuthorizeannotationstatic AuthorizationManagerBeforeMethodInterceptorpreAuthorize(PreAuthorizeAuthorizationManager authorizationManager)Creates an interceptor for thePreAuthorizeannotationstatic AuthorizationManagerBeforeMethodInterceptorsecured()Creates an interceptor for theSecuredannotationstatic AuthorizationManagerBeforeMethodInterceptorsecured(SecuredAuthorizationManager authorizationManager)Creates an interceptor for theSecuredannotationvoidsetOrder(int order)
-
-
-
Constructor Detail
-
AuthorizationManagerBeforeMethodInterceptor
public AuthorizationManagerBeforeMethodInterceptor(org.springframework.aop.Pointcut pointcut, AuthorizationManager<org.aopalliance.intercept.MethodInvocation> authorizationManager)Creates an instance.- Parameters:
pointcut- thePointcutto useauthorizationManager- theAuthorizationManagerto use
-
-
Method Detail
-
preAuthorize
public static AuthorizationManagerBeforeMethodInterceptor preAuthorize()
Creates an interceptor for thePreAuthorizeannotation- Returns:
- the interceptor
-
preAuthorize
public static AuthorizationManagerBeforeMethodInterceptor preAuthorize(PreAuthorizeAuthorizationManager authorizationManager)
Creates an interceptor for thePreAuthorizeannotation- Parameters:
authorizationManager- thePreAuthorizeAuthorizationManagerto use- Returns:
- the interceptor
-
secured
public static AuthorizationManagerBeforeMethodInterceptor secured()
Creates an interceptor for theSecuredannotation- Returns:
- the interceptor
-
secured
public static AuthorizationManagerBeforeMethodInterceptor secured(SecuredAuthorizationManager authorizationManager)
Creates an interceptor for theSecuredannotation- Parameters:
authorizationManager- theSecuredAuthorizationManagerto use- Returns:
- the interceptor
-
jsr250
public static AuthorizationManagerBeforeMethodInterceptor jsr250()
Creates an interceptor for the JSR-250 annotations- Returns:
- the interceptor
-
jsr250
public static AuthorizationManagerBeforeMethodInterceptor jsr250(Jsr250AuthorizationManager authorizationManager)
Creates an interceptor for the JSR-250 annotations- Parameters:
authorizationManager- theJsr250AuthorizationManagerto use- Returns:
- the interceptor
-
invoke
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation mi) throws java.lang.ThrowableDetermine if anAuthenticationhas access to theMethodInvocationusing the configuredAuthorizationManager.- Specified by:
invokein interfaceorg.aopalliance.intercept.MethodInterceptor- Parameters:
mi- theMethodInvocationto check- Throws:
AccessDeniedException- if access is not grantedjava.lang.Throwable
-
getOrder
public int getOrder()
- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
setOrder
public void setOrder(int order)
-
getPointcut
public org.springframework.aop.Pointcut getPointcut()
- Specified by:
getPointcutin interfaceorg.springframework.aop.PointcutAdvisor
-
getAdvice
public org.aopalliance.aop.Advice getAdvice()
- Specified by:
getAdvicein interfaceorg.springframework.aop.Advisor
-
isPerInstance
public boolean isPerInstance()
- Specified by:
isPerInstancein interfaceorg.springframework.aop.Advisor
-
-