diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index 04fdb7f6..f483ede9 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java index e77a7bbb..29ae85f6 100644 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java @@ -621,6 +621,24 @@ public class CoeCooperationAPIManager { CooperationCache.updateTeamInfo(teamId); } + public void addPermDataToTeamAndRole(String teamId, String permId){ + // 1、向小组权限中添加数据 + CoeCooperationTeamPermModel teamPerm = new CoeCooperationTeamPermModel(UUIDGener.getUUID(), teamId, permId); + new CoeCooperationTeamPermDao().insert(teamPerm); + + // 2、获取小组下非隐藏角色(用户权限)的角色 + List coeCooperationRoleModels = queryCooperationRoleList(teamId); + for (CoeCooperationRoleModel roleModel : coeCooperationRoleModels) { + // 判断是否设定的默认全部权限 + if (!CoeCooperationConst.PERM_ALL.equals(roleModel.getDataPerm())) { + CoeCooperationRolePermModel rolePerm = new CoeCooperationRolePermModel(UUIDGener.getUUID(), teamId, roleModel.getId(), permId); + new CoeCooperationRolePermDao().insert(rolePerm); + } + } + //更新用户权限缓存 + CooperationCache.updateTeamInfo(teamId); + } + // 批量添加数据 public void addPermDataToTeamAndRoleBatch(String teamId, Set permIds){ // 1、向小组权限中添加数据 @@ -642,6 +660,9 @@ public class CoeCooperationAPIManager { new CoeCooperationRolePermDao().batchInsert(permRoleModels); } } + + //更新用户权限缓存 + CooperationCache.updateTeamInfo(teamId); } /** diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java index cf04bf4a..a89ee3f7 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java @@ -8363,8 +8363,8 @@ public class CoeProcessLevelWeb extends ActionWeb { List allTeamInfo = CoeCooperationAPIManager.getInstance().getAllTeamInfo(); allTeamInfo.parallelStream().forEach(teamInfo -> { boolean isPerm = teamInfo.getVersionIds().stream().anyMatch(teamPermId -> teamPermId.equals(parentId)); - if (isPerm){ - CoeCooperationAPIManager.getInstance().addRepositoryToTeamAndRolePerm(teamInfo.getTeamId(), model.getVersionId()); + if (isPerm && !teamInfo.getVersionIds().contains(model.getVersionId())){ // 当前新建的文件 父级有权限且自身没在小组权限中 + CoeCooperationAPIManager.getInstance().addPermDataToTeamAndRole(teamInfo.getTeamId(), model.getVersionId()); } }); } @@ -8471,8 +8471,8 @@ public class CoeProcessLevelWeb extends ActionWeb { List allTeamInfo = CoeCooperationAPIManager.getInstance().getAllTeamInfo(); allTeamInfo.parallelStream().forEach(teamInfo -> { boolean isPerm = teamInfo.getVersionIds().stream().anyMatch(teamPermId -> teamPermId.equals(parentId)); - if (isPerm){ - CoeCooperationAPIManager.getInstance().addRepositoryToTeamAndRolePerm(teamInfo.getTeamId(), model.getVersionId()); + if (isPerm && !teamInfo.getVersionIds().contains(model.getVersionId())){ // 当前新建的文件 父级有权限且自身没在小组权限中 + CoeCooperationAPIManager.getInstance().addPermDataToTeamAndRole(teamInfo.getTeamId(), model.getVersionId()); } }); } @@ -8628,8 +8628,8 @@ public class CoeProcessLevelWeb extends ActionWeb { List allTeamInfo = CoeCooperationAPIManager.getInstance().getAllTeamInfo(); allTeamInfo.parallelStream().forEach(teamInfo -> { boolean isPerm = teamInfo.getVersionIds().stream().anyMatch(teamPermId -> teamPermId.equals(parentId)); - if (isPerm){ - CoeCooperationAPIManager.getInstance().addRepositoryToTeamAndRolePerm(teamInfo.getTeamId(), model.getVersionId()); + if (isPerm && !teamInfo.getVersionIds().contains(model.getVersionId())){ // 当前新建的文件 父级有权限且自身没在小组权限中 + CoeCooperationAPIManager.getInstance().addPermDataToTeamAndRole(teamInfo.getTeamId(), model.getVersionId()); } }); }