https://blog.csdn.net/caoyang0105/article/details/82851162
先添加 thymeleaf+shiro的依赖
<dependency>
<groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>2.0.0</version>
</dependency>
html页面
<html lang="en" xmlns:th="http://www.thymeleaf.org"
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
这样就能支持shiro标签了
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="oa:design:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="oa:design:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-info hidden-input" id="expandAllBtn">
<i class="fa fa-exchange"></i> 展开/折叠
</a>
<p shiro:hasRole="admin">
</div>