Class AuthorizingMethodInterceptor

java.lang.Object
org.apache.shiro.aop.MethodInterceptorSupport
org.apache.shiro.authz.aop.AuthorizingMethodInterceptor
All Implemented Interfaces:
MethodInterceptor
Direct Known Subclasses:
AnnotationsAuthorizingMethodInterceptor

Basic abstract class to support intercepting methods that perform authorization (access control) checks.
Since:
0.9
  • Constructor Details

  • Method Details

    • invoke

      public Object invoke(MethodInvocation methodInvocation) throws Throwable
      Invokes the specified method (methodInvocation.proceed() if authorization is allowed by first calling assertAuthorized.
      Parameters:
      methodInvocation - the MethodInvocation to execute.
      Returns:
      the result of the invocation
      Throws:
      Throwable - if the method invocation throws a Throwable or if an error occurs in pre/post/finally advice.
    • assertAuthorized

      protected abstract void assertAuthorized(MethodInvocation methodInvocation) throws AuthorizationException
      Asserts that the specified MethodInvocation is allowed to continue by performing any necessary authorization (access control) checks first.
      Parameters:
      methodInvocation - the MethodInvocation to invoke.
      Throws:
      AuthorizationException - if the methodInvocation should not be allowed to continue/execute.