mirror of https://github.com/jeecgboot/jeecg-boot
JimuReport 1.9.3版本支持权限,将平台权限传递给积木报表
parent
327f034640
commit
b4cd341abc
|
@ -82,4 +82,30 @@ public class JimuReportTokenService implements JmReportTokenServiceI {
|
|||
// 将所有信息存放至map 解析sql/api会根据map的键值解析
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将jeecgboot平台的权限传递给积木报表
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String[] getPermissions(String token) {
|
||||
// 获取用户信息
|
||||
String username = JwtUtil.getUsername(token);
|
||||
SysUserCacheInfo userInfo = null;
|
||||
try {
|
||||
userInfo = sysBaseApi.getCacheUser(username);
|
||||
} catch (Exception e) {
|
||||
log.error("获取用户信息异常:"+ e.getMessage());
|
||||
}
|
||||
if(userInfo == null){
|
||||
return null;
|
||||
}
|
||||
// 查询权限
|
||||
Set<String> userPermissions = sysBaseApi.getUserPermissionSet(userInfo.getSysUserId());
|
||||
if(CollectionUtils.isEmpty(userPermissions)){
|
||||
return null;
|
||||
}
|
||||
return userPermissions.toArray(new String[0]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue