Class 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 java.lang.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
    • Constructor Detail

      • AuthorizationManagerAfterMethodInterceptor

        public AuthorizationManagerAfterMethodInterceptor​(org.springframework.aop.Pointcut pointcut,
                                                          AuthorizationManager<MethodInvocationResult> authorizationManager)
        Creates an instance.
        Parameters:
        pointcut - the Pointcut to use
        authorizationManager - the AuthorizationManager to use
    • Method Detail

      • invoke

        public java.lang.Object invoke​(org.aopalliance.intercept.MethodInvocation mi)
                                throws java.lang.Throwable
        Determine if an Authentication has access to the MethodInvocation using the AuthorizationManager.
        Specified by:
        invoke in interface org.aopalliance.intercept.MethodInterceptor
        Parameters:
        mi - the MethodInvocation to check
        Throws:
        AccessDeniedException - if access is not granted
        java.lang.Throwable
      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered
      • setOrder

        public void setOrder​(int order)
      • getPointcut

        public org.springframework.aop.Pointcut getPointcut()
        Specified by:
        getPointcut in interface org.springframework.aop.PointcutAdvisor
      • getAdvice

        public org.aopalliance.aop.Advice getAdvice()
        Specified by:
        getAdvice in interface org.springframework.aop.Advisor
      • isPerInstance

        public boolean isPerInstance()
        Specified by:
        isPerInstance in interface org.springframework.aop.Advisor