功能优化 资产库文件移动 目标目录及其所有父级目录同时放入小组权限中
This commit is contained in:
parent
6418210f54
commit
59e2e0187a
Binary file not shown.
@ -621,6 +621,29 @@ public class CoeCooperationAPIManager {
|
||||
CooperationCache.updateTeamInfo(teamId);
|
||||
}
|
||||
|
||||
// 批量添加数据
|
||||
public void addPermDataToTeamAndRoleBatch(String teamId, Set<String> permIds){
|
||||
// 1、向小组权限中添加数据
|
||||
List<CoeCooperationTeamPermModel> permModels = permIds.stream().map(permId -> {
|
||||
CoeCooperationTeamPermModel teamPerm = new CoeCooperationTeamPermModel(UUIDGener.getUUID(), teamId, permId);
|
||||
return teamPerm;
|
||||
}).collect(Collectors.toList());
|
||||
new CoeCooperationTeamPermDao().batchInsert(permModels);
|
||||
|
||||
// 2、获取小组下非隐藏角色(用户权限)的角色
|
||||
List<CoeCooperationRoleModel> coeCooperationRoleModels = queryCooperationRoleList(teamId);
|
||||
for (CoeCooperationRoleModel roleModel : coeCooperationRoleModels) {
|
||||
// 判断是否设定的默认全部权限
|
||||
if (!CoeCooperationConst.PERM_ALL.equals(roleModel.getDataPerm())) {
|
||||
List<CoeCooperationRolePermModel> permRoleModels = permIds.stream().map(permId -> {
|
||||
CoeCooperationRolePermModel rolePerm = new CoeCooperationRolePermModel(UUIDGener.getUUID(), teamId, roleModel.getId(), permId);
|
||||
return rolePerm;
|
||||
}).collect(Collectors.toList());
|
||||
new CoeCooperationRolePermDao().batchInsert(permRoleModels);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户在指定小组中的角色
|
||||
* @param teamId
|
||||
|
||||
@ -11042,7 +11042,10 @@ public String deleteReply(String replyid, String messageid) {
|
||||
if (isPerm){
|
||||
Set<String> toBeInsertPermIds = new HashSet<>();
|
||||
recursionLookUp(targetId, toBeInsertPermIds);
|
||||
toBeInsertPermIds.forEach(permId -> CoeCooperationAPIManager.getInstance().addRepositoryToTeamAndRolePerm(teamInfo.getTeamId(), permId));
|
||||
toBeInsertPermIds = toBeInsertPermIds.stream()
|
||||
.filter(permId -> !teamInfo.getVersionIds().contains(permId))
|
||||
.collect(Collectors.toSet());
|
||||
CoeCooperationAPIManager.getInstance().addPermDataToTeamAndRoleBatch(teamInfo.getTeamId(), toBeInsertPermIds);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user