删除判断逻辑增加,增加文件下不允许新建文件逻辑
This commit is contained in:
parent
84af083855
commit
3da4d9dabe
@ -8346,6 +8346,11 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getPalProcessLevelCreateMethodList(String category, String methodId, String fileId) {
|
public String getPalProcessLevelCreateMethodList(String category, String methodId, String fileId) {
|
||||||
|
if(!"process.framework".equals(methodId) && !"default".equals(methodId)){//不是架构,或者文件夹
|
||||||
|
ResponseObject ro = ResponseObject.newErrResponse();
|
||||||
|
ro.msg("methodId:"+methodId+"当前所选择目录不是文件夹或者流程架构,请选择正确的目录!");
|
||||||
|
return ro.toString();
|
||||||
|
}
|
||||||
ResponseObject ro = ResponseObject.newOkResponse();
|
ResponseObject ro = ResponseObject.newOkResponse();
|
||||||
JSONArray fileArr = new JSONArray();// 文件类模型,可以画图
|
JSONArray fileArr = new JSONArray();// 文件类模型,可以画图
|
||||||
JSONArray folderArr = new JSONArray();// 文件夹类模型,作为文件夹
|
JSONArray folderArr = new JSONArray();// 文件夹类模型,作为文件夹
|
||||||
@ -11626,9 +11631,10 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
PALRepositoryCache.getAllChildrenModelsByPid(model.getWsId(), model.getId(), childList, ids);
|
PALRepositoryCache.getAllChildrenModelsByPid(model.getWsId(), model.getId(), childList, ids);
|
||||||
removeList.addAll(childList);
|
removeList.addAll(childList);
|
||||||
for (PALRepositoryModel removeModel : removeList) {
|
for (PALRepositoryModel removeModel : removeList) {
|
||||||
//普通用户不允许删除已发布的文件
|
//校验禁止删除逻辑
|
||||||
if (removeModel.isPublish() && !"admin".equals(_uc.getUID())) {
|
String errorResponse = checkRemovalPermission(removeModel, _uc);
|
||||||
return ResponseObject.newErrResponse("已发布文件["+ removeModel.getName() + VersionUtil.getVersionStrV(removeModel.getVersion()) + "]不允许删除,请联系系统管理员!").toString();
|
if (errorResponse != null) {
|
||||||
|
return errorResponse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -13127,6 +13133,18 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
return ro.toString();
|
return ro.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 提取重复的错误判断逻辑到一个方法中
|
||||||
|
private String checkRemovalPermission(PALRepositoryModel model, UserContext _uc) {
|
||||||
|
if ("admin".equals(_uc.getUID())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//非设计状态(即草稿)不允许删除
|
||||||
|
if (model.isPublish() || model.isStop() || model.isApproval()) {
|
||||||
|
return ResponseObject.newErrResponse("文件[" + model.getName() + VersionUtil.getVersionStrV(model.getVersion()) + "]非草稿状态不允许删除,请联系系统管理员!").toString();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
class ComparatorMap implements Comparator<PALRepositoryModel> {
|
class ComparatorMap implements Comparator<PALRepositoryModel> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user