use of cn.exrick.manager.pojo.TbShiroFilter in project xmall by Exrick.
the class MyShiroFilterFactoryBean method setFilterChainDefinitions.
/**
* 从数据库动态读取权限
*/
@Override
public void setFilterChainDefinitions(String definitions) {
MyShiroFilterFactoryBean.definitions = definitions;
// 数据库动态权限
List<TbShiroFilter> list = systemService.getShiroFilter();
for (TbShiroFilter tbShiroFilter : list) {
// 字符串拼接权限
definitions = definitions + tbShiroFilter.getName() + " = " + tbShiroFilter.getPerms() + "\n";
}
log.info(definitions);
// 从配置文件加载权限配置
Ini ini = new Ini();
ini.load(definitions);
Ini.Section section = ini.getSection("urls");
if (CollectionUtils.isEmpty(section)) {
section = ini.getSection("");
}
this.setFilterChainDefinitionMap(section);
}
use of cn.exrick.manager.pojo.TbShiroFilter in project xmall by Exrick.
the class SystemController method getShiroList.
@RequestMapping(value = "/sys/shiro/list", method = RequestMethod.GET)
@ApiOperation(value = "获取shiro过滤链配置")
public DataTablesResult getShiroList(@ModelAttribute TbUser tbUser) {
DataTablesResult result = new DataTablesResult();
List<TbShiroFilter> list = systemService.getShiroFilter();
result.setData(list);
result.setSuccess(true);
return result;
}
Aggregations