shiro

Apache Shiro: How do I add a new annotation method interceptor into the mix?


I am looking at this class: https://shiro.apache.org/static/1.3.1/xref/org/apache/shiro/spring/security/interceptor/AopAllianceAnnotationsAuthorizingMethodInterceptor.html

It is registering all method interceptors that work with Shiro. Among them is this interceptor:

PermissionAnnotationMethodInterceptor . I want to create my own custom interceptor and integrate it into the Shiro model. My own interceptor would be replacing the existing PermissionAnnotationMethodInterceptor.

How do I do it in a clean programmatic Spring Boot way?


Solution

  • You should be able to replace the AuthorizationAttributeSourceAdvisor bean with your own implementation

    Or implement your own annotations anyway you want and disable Shiro's annotation processing: shiro.annotations.enabled=false