<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.9</version>
</denpendency>
<aop:config proxy-target-class="true" />
<bean class="org.apache.shiro.spring.LifecycleBeanPostProcessor" />
<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
<property name="securityManager" ref="securityManger" />
</bean>
@RequiresRoles("admin")
@RequestMapping(value="/testRole", method = RequestMethod.GET)
@ResponseBody
public String testRole() {
return "testRole success";
}
@RequiresRoles("admin1")
@RequestMapping(value="/testRole1", method = RequestMethod.GET)
@ResponseBody
public String testRole1() {
return "testRole1 success";
}
@RequiresPermissions("xxx")