# Conflicts:
#	com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar
This commit is contained in:
shangguochao 2022-07-05 21:20:49 +08:00
commit a620b40a07
4 changed files with 42 additions and 4 deletions

View File

@ -647,7 +647,7 @@ public class CoeCooperationAPIManager {
havingBatchPerm = userOperatePermission.contains(CoeCooperationConst.ACTION_BATCH); havingBatchPerm = userOperatePermission.contains(CoeCooperationConst.ACTION_BATCH);
} }
ro.put("isOlderVersion", !isOlderVersion);// ro.put("isOlderVersion", isOlderVersion);//
ro.put("havingCreatePerm", havingCreatePerm);// 新增流程权限 ro.put("havingCreatePerm", havingCreatePerm);// 新增流程权限
ro.put("havingBatchPerm", havingBatchPerm);// 批量操作 ro.put("havingBatchPerm", havingBatchPerm);// 批量操作
Set<String> dataVisitablePermission = CooperationCache.getUserDataVisitablePermission(teamId, userId,true); Set<String> dataVisitablePermission = CooperationCache.getUserDataVisitablePermission(teamId, userId,true);
@ -656,6 +656,33 @@ public class CoeCooperationAPIManager {
} }
} }
/**
* 获取小组成员指定文件的操作权限
* @param teamId
* @param userId
* @param versionId
* @param ro
*/
public void queryCooperationFileActionPerm(String teamId, String userId,String versionId, ResponseObject ro) {
boolean isOlderVersion = SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal", "IsOlderVersion", true);
if (isOlderVersion){
return;
}
boolean havingWritePerm = true;
boolean havingRemovePerm = true;
boolean havingVersionManagePerm = true;
int validUserPermDataCount = 0;// 当前小组成员有效(流程表中存在)的数据权限数量
if (StringUtils.isNotEmpty(teamId) && isInstall()) {
Set<String> userOperatePermission = CooperationCache.getUserDataOperatePermission(teamId, userId,versionId);
havingWritePerm = userOperatePermission.contains(CoeCooperationConst.ACTION_WRITE);// 新增修改权限
havingRemovePerm = userOperatePermission.contains(CoeCooperationConst.ACTION_DELETE);// 删除权限
havingVersionManagePerm = userOperatePermission.contains(CoeCooperationConst.ACTION_VERSION);// 版本管理权限
}
ro.put("havingWritePerm", havingWritePerm);// 新增修改权限
ro.put("havingRemovePerm", havingRemovePerm);// 删除权限
ro.put("havingVersionManagePerm", havingVersionManagePerm);// 版本管理权限
}
/** /**
* 判断小组成员是否有某类操作权限 * 判断小组成员是否有某类操作权限
* @param teamId * @param teamId

View File

@ -28,6 +28,7 @@ import java.util.*;
/** /**
*
* 同步部门岗位数据 * 同步部门岗位数据
*/ */
public class SynchronousOrgJob implements IJob { public class SynchronousOrgJob implements IJob {
@ -47,7 +48,7 @@ public class SynchronousOrgJob implements IJob {
String plRid1 = UUIDGener.getUUID(); String plRid1 = UUIDGener.getUUID();
String id1 = UUIDGener.getUUID(); String id1 = UUIDGener.getUUID();
orgdepartmentList = DBSql.getMaps("select DEPARTMENTNAME,ID,LAYER,PARENTDEPARTMENTID,ORDERINDEX from ORGDEPARTMENT limit 20"); orgdepartmentList = DBSql.getMaps("select DEPARTMENTNAME,ID,LAYER,PARENTDEPARTMENTID,ORDERINDEX from ORGDEPARTMENT ");
Timestamp nowTime = new Timestamp(System.currentTimeMillis()); Timestamp nowTime = new Timestamp(System.currentTimeMillis());

View File

@ -3,6 +3,7 @@ package com.actionsoft.apps.coe.pal.pal.repository.web;
import com.actionsoft.apps.AppPlatformConfig; import com.actionsoft.apps.AppPlatformConfig;
import com.actionsoft.apps.AppsConst; import com.actionsoft.apps.AppsConst;
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager; import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI; import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst; import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
import com.actionsoft.apps.coe.pal.pal.repository.util.DiagramsUtil; import com.actionsoft.apps.coe.pal.pal.repository.util.DiagramsUtil;
@ -8862,7 +8863,8 @@ public class CoeProcessLevelWeb extends ActionWeb {
JSONArray repositoryPathData = CoeProcessLevelUtil.getRepositoryPath(id); JSONArray repositoryPathData = CoeProcessLevelUtil.getRepositoryPath(id);
if (UtilString.isNotEmpty(teamId)) { if (UtilString.isNotEmpty(teamId)) {
JSONArray tempArr = new JSONArray(); JSONArray tempArr = new JSONArray();
List<String> permVerIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID()); // List<String> permVerIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
Set<String> permVerIds = CooperationCache.getUserDataVisitablePermission(teamId, _uc.getUID(), false);
for (int i = 0; i < repositoryPathData.size(); i++) { for (int i = 0; i < repositoryPathData.size(); i++) {
JSONObject currObj = repositoryPathData.getJSONObject(i); JSONObject currObj = repositoryPathData.getJSONObject(i);
String pathId = currObj.getString("id"); String pathId = currObj.getString("id");
@ -9256,6 +9258,14 @@ public class CoeProcessLevelWeb extends ActionWeb {
object.put("photoType", photoType); object.put("photoType", photoType);
object.put("photo", photo); object.put("photo", photo);
ResponseObject ro = ResponseObject.newOkResponse(); ResponseObject ro = ResponseObject.newOkResponse();
//新版权限获取文件操作权限
CoeCooperationAPIManager.getInstance().queryCooperationFileActionPerm(teamId,_uc.getUID(),model.getVersionId(),ro);
Map data = (Map)ro.getData();
if (data != null && !data.isEmpty()){
object.put("havingWritePerm", data.get("havingWritePerm"));// 新增修改权限
object.put("havingRemovePerm",data.get("havingRemovePerm") );// 删除权限
object.put("havingVersionManagePerm",data.get("havingVersionManagePerm") );// 版本管理权限
}
ro.setData(object); ro.setData(object);
return ro.toString(); return ro.toString();
} }