Skip to content

Commit

Permalink
JimuReport 1.9.3版本支持权限,将平台权限传递给积木报表
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangdaiscott committed Jan 12, 2025
1 parent 327f034 commit b4cd341
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,30 @@ public Map<String, Object> getUserInfo(String token) {
// 将所有信息存放至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]);
}
}

0 comments on commit b4cd341

Please sign in to comment.