Spring Security
  1. Spring Security
  2. SEC-1262

Aspectj(LTW) JoinPoints are not handled by PreInvocationAuthorizationAdviceVoter

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 3.0.0 M2
    • Fix Version/s: 3.0.3, 3.1.0.M1
    • Component/s: ACLs
    • Labels:
      None
    • Environment:
      all

      Description

      The AspectJ joinpoints are not supported by the default expression based method security implementation org.springframework.security.access.prepost.PreInvocationAuthorizationAdviceVoter. The PreInvocationAuthirzationAdviceVoter is currently hardwired to deal with MethodInvocation (Spring AOP) specifically and there are no equivalents (as far as I saw) that deals with AspectJ Joinpoints. Since Spring AOP based approach does not intercetp local method calls , important security access expressions could be skipped and having AspectJ JointPoint support would be really useful.
      Currently we have a customized version of PreInvocationAuthorizationAdviceVoter that wraps the JoinPoint as as MethodInvocation and works fine, but a framework support would be ideal.

        Issue Links

          Activity

          Hide
          Luke Taylor added a comment -

          This should now work. I've created a new AspectJ interceptor which extends MethodSecurityInterceptor and uses an adapter which exposes the JoinPont as a MethodInvocation, not just to the voters, but to all the method-security infrastructure classes. I've also added support for Pre/Post annotations to the AnnotationSecurityAspect and changed it to use this interceptor.

          Show
          Luke Taylor added a comment - This should now work. I've created a new AspectJ interceptor which extends MethodSecurityInterceptor and uses an adapter which exposes the JoinPont as a MethodInvocation, not just to the voters, but to all the method-security infrastructure classes. I've also added support for Pre/Post annotations to the AnnotationSecurityAspect and changed it to use this interceptor.
          Hide
          Luke Taylor added a comment -

          Note that the previous AspectJ interceptor classes are now deprecated as of 3.0.3.

          Show
          Luke Taylor added a comment - Note that the previous AspectJ interceptor classes are now deprecated as of 3.0.3.

            People

            • Assignee:
              Luke Taylor
              Reporter:
              Aswin Nair
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: