This is because the spring interceptor is not turned on and the following code is added to the Spring-mvc.xml
<Beanclass= "Org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"depends-on= "Lifecyclebeanpostprocessor" /><Beanclass= "Org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor"> < Propertyname= "SecurityManager"ref= "SecurityManager" /></Bean>
Lifecyclebeanpostprocessor and SecurityManager are defined in the Shiro configuration file:
<BeanID= "Lifecyclebeanpostprocessor"class= "Org.apache.shiro.spring.LifecycleBeanPostProcessor"></Bean><!--Shiro Security Manager - <BeanID= "SecurityManager"class= "Org.apache.shiro.web.mgt.DefaultWebSecurityManager"> < Propertyname= "Realm"ref= "Jdbcrealm"></ Property> < Propertyname= "CacheManager"ref= "CacheManager"></ Property> </Bean>
Shiro adding annotations @requirespermissions not working