Apache Shiro:如何将新的注释方法拦截器添加到组合中?

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

我正在看这个class:https://shiro.apache.org/static/1.3.1/xref/org/apache/shiro/spring/security/interceptor/AopAllianceAnnotationsAuthorizingMethodInterceptor.html

它正在注册与 Shiro 一起使用的所有方法拦截器。其中就有这个拦截器:

PermissionAnnotationMethodInterceptor。 我想创建自己的自定义拦截器并将其集成到 Shiro 模型中。 我自己的拦截器将替换现有的 PermissionAnnotationMethodInterceptor.

我如何以干净的程序化 Spring 引导方式进行操作?

您应该可以用自己的实现替换 AuthorizationAttributeSourceAdvisor bean

或者以任何你想要的方式实现你自己的注解并禁用 Shiro 的注解处理:shiro.annotations.enabled=false