小组权限调整,批量删除接口加入小组文件权限判断
This commit is contained in:
parent
19a02ab05a
commit
b19c397d6f
@ -9504,9 +9504,21 @@ public String deleteReply(String replyid, String messageid) {
|
||||
public String removePalRepositoryLevel(String wsId, String teamId, String repositoryIds) {
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
JSONArray repositoryIdArr = JSONArray.parseArray(repositoryIds);
|
||||
boolean isOlderVersion = SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal", "IsOlderVersion", true);
|
||||
int failed = 0;
|
||||
for (int i = 0; i < repositoryIdArr.size(); i++) {
|
||||
String repositoryId = repositoryIdArr.getString(i);
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(repositoryId);
|
||||
//新版小组的权限校验
|
||||
if (!isOlderVersion){
|
||||
ResponseObject res = ResponseObject.newOkResponse();
|
||||
CoeCooperationAPIManager.getInstance().queryCooperationFileActionPerm(teamId, _uc.getUID(),model.getVersionId(),res);
|
||||
Map<String,Boolean> data = (Map) res.getData();
|
||||
if (!data.get("havingRemovePerm")){
|
||||
failed ++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
String result = removeTreeNode(repositoryId, wsId);
|
||||
JSONObject moveRo = JSONObject.parseObject(result);
|
||||
if (!"ok".equals(moveRo.getString("result"))) {
|
||||
@ -9514,6 +9526,9 @@ public String deleteReply(String replyid, String messageid) {
|
||||
return ResponseObject.newErrResponse(moveRo.getString("msg")).toString();
|
||||
}
|
||||
}
|
||||
if (!isOlderVersion && failed >= repositoryIdArr.size()){
|
||||
return ResponseObject.newErrResponse("删除文件失败,无操作权限").toString();
|
||||
}
|
||||
// 操作行为日志记录
|
||||
if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
|
||||
CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_DELETE, CoEOpLogConst.INFO_REPOSITORY_DELETE);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user