增加日志
This commit is contained in:
parent
3647cc89b0
commit
71a32c4e74
@ -4,5 +4,8 @@
|
||||
},
|
||||
"dev": {
|
||||
"host": "https://dev-app.axzo.cn/msg-center/webApi/message/"
|
||||
},
|
||||
"test": {
|
||||
"host": "https://test-api.axzo.cn/"
|
||||
}
|
||||
}
|
||||
@ -33,4 +33,37 @@ Content-Type: application/json
|
||||
> reponse-check.js
|
||||
|
||||
|
||||
###
|
||||
POST {{host}}/tyr/api/v2/auth/batchListIdentityFromPermission
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"featureCode": "CMS_WEB_PROJ_0528",
|
||||
"ouId": 5836,
|
||||
"workspaceId":326,
|
||||
"workspaceJoinType": 1
|
||||
}
|
||||
|
||||
> reponse-check.js
|
||||
|
||||
###
|
||||
POST {{host}}/tyr/api/v2/auth/listIdentityFromPermission
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"featureCode": "CMP_APP_PROJ_0056",
|
||||
"ouId": 5812,
|
||||
"workspaceId":311,
|
||||
"workspaceJoinType": 1
|
||||
}
|
||||
|
||||
> reponse-check.js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -587,19 +587,23 @@ public class TyrSaasAuthServiceImpl implements TyrSaasAuthService {
|
||||
|
||||
//查询OU-工作台下的角色
|
||||
List<SaasRole> roleList = roleService.listForOUWorkspace(ouId, workspaceId, req.getWorkspaceJoinType());
|
||||
log.info("====查询OU-工作台下的角色:{}===",roleList);
|
||||
|
||||
//查询角色及权限
|
||||
List<SaasRoleVO> rolePermissions = roleService.getByIds(roleList.stream().map(SaasRole::getId).collect(Collectors.toList()),
|
||||
null, Lists.newArrayList(workspaceId), Lists.newArrayList(ouId), true);
|
||||
|
||||
log.info("====查询角色及权限:{}===",rolePermissions);
|
||||
//计算角色实际的权限 - 匹配请求的权限 --> 实际拥有权限的角色
|
||||
Set<Long> featureIds = features.stream().map(SaasFeature::getId).collect(Collectors.toSet());
|
||||
List<SaasRoleVO> matchedRoleList = rolePermissions.stream()
|
||||
.filter(rp -> rp.getMatchFeature(workspaceId, ouId).stream()
|
||||
.anyMatch(f -> featureIds.contains(f.getPermissionPointId())))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
log.info("====计算角色实际的权限 - 匹配请求的权限 --> 实际拥有权限的角色:{}===",featureIds);
|
||||
//查询角色下用户
|
||||
List<Long> matchedRoleIds = matchedRoleList.stream().map(SaasRoleVO::getId).collect(Collectors.toList());
|
||||
log.info("====查询角色下用户:{}===",matchedRoleIds);
|
||||
//追加工作台超管
|
||||
Set<Long> superAdmins = roleList
|
||||
.stream()
|
||||
@ -608,7 +612,7 @@ public class TyrSaasAuthServiceImpl implements TyrSaasAuthService {
|
||||
.collect(Collectors.toSet());
|
||||
matchedRoleIds.addAll(superAdmins);
|
||||
List<SaasRoleUserRelation> relationList = roleUserService.listByRoleIds(matchedRoleIds);
|
||||
|
||||
log.info("====追加工作台超管:{}===",superAdmins);
|
||||
//构建用户-去重(identityId-identityType)
|
||||
List<ListIdentityFromPermissionResp.UserVO> users = new ArrayList<>();
|
||||
Set<String> filterSet = new HashSet<>();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user