<dependency>
<groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactld>shiro-spring</artifactId>
<version>1.7.0</version>
</dependency>
(1) 首先创建ShiroFilterFactoryBean(安全过滤器) //这是shiro的核心一步
(2)创建完对象后调用setSecurityManager()方法并传入参数
(3)添加shiro的内置过滤器
(4)进行授权
filterChainDefinitionMap.put("/user/update","perms[user:upate]"); //此句的意思是拥有 user:update权限才可以进如localhost:8080/user/update界面。
原文:https://www.cnblogs.com/downson/p/14248173.html