按钮"/>
shio控制页面按钮
今天测试成功了 shiro 利用权限 控制 页面 按钮
1.添加依赖
<dependency>
<groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>1.2.1</version>
</dependency>
版本问题的话,可以生成 2.0.0
2.然后在Configuration类里面添加:
@Beanpublic ShiroDialect shiroDialect() {return new ShiroDialect();}
3.页面添加引用:
<htmlxmlns:th=""xmlns:shiro="" >
4.在<a>标签外添加 shiro 权限
<shiro:hasPermission name="test:aa"><a>修改</a>
</shiro:hasPermission>
name是用户拥有的权限。
更多推荐
shio控制页面按钮
发布评论