From 3747d3536f15690755519de6aa9f1097e4e53eb5 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 29 Aug 2024 16:50:58 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82-=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=A8=A1=E5=9D=97-=E5=B7=A5=E7=A8=8B=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E8=A6=81=E5=83=8F=E8=80=81=E5=B9=B3=E5=8F=B0=E4=B8=80=E6=A0=B7?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=9C=A8=E5=8F=91=E5=B8=83=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E8=AF=A6=E6=83=85=E7=9A=84=EF=BC=8C=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E5=8F=AF=E4=BB=A5=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1234071345135616]后端-产品需求-发布模块-工程目录要像老平台一样,可以在发布作业详情的,编译步骤可以查看 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1234071345135616 --- .../type/DeployJobSourceTypeHandler.java | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/main/java/neatlogic/module/deploy/job/source/type/DeployJobSourceTypeHandler.java b/src/main/java/neatlogic/module/deploy/job/source/type/DeployJobSourceTypeHandler.java index 33521802..7518c041 100644 --- a/src/main/java/neatlogic/module/deploy/job/source/type/DeployJobSourceTypeHandler.java +++ b/src/main/java/neatlogic/module/deploy/job/source/type/DeployJobSourceTypeHandler.java @@ -45,9 +45,8 @@ import neatlogic.framework.dao.mapper.runner.RunnerMapper; import neatlogic.framework.deploy.auth.BATCHDEPLOY_MODIFY; import neatlogic.framework.deploy.auth.DEPLOY_MODIFY; import neatlogic.framework.deploy.auth.core.DeployAppAuthChecker; -import neatlogic.framework.deploy.constvalue.BuildNoStatus; -import neatlogic.framework.deploy.constvalue.JobSource; -import neatlogic.framework.deploy.constvalue.JobSourceType; +import neatlogic.framework.deploy.constvalue.*; +import neatlogic.framework.deploy.dto.app.DeployAppConfigAuthorityActionVo; import neatlogic.framework.deploy.dto.app.DeployPipelineConfigVo; import neatlogic.framework.deploy.dto.app.DeployProfileVo; import neatlogic.framework.deploy.dto.instance.DeployInstanceVersionVo; @@ -60,6 +59,7 @@ import neatlogic.framework.deploy.dto.version.DeployVersionBuildNoVo; import neatlogic.framework.deploy.dto.version.DeployVersionEnvVo; import neatlogic.framework.deploy.dto.version.DeployVersionVo; import neatlogic.framework.deploy.exception.*; +import neatlogic.framework.dto.AuthenticationInfoVo; import neatlogic.framework.dto.globallock.GlobalLockVo; import neatlogic.framework.dto.runner.RunnerGroupVo; import neatlogic.framework.dto.runner.RunnerMapVo; @@ -73,11 +73,7 @@ import neatlogic.framework.globallock.dao.mapper.GlobalLockMapper; import neatlogic.framework.integration.authentication.enums.AuthenticateType; import neatlogic.framework.util.HttpRequestUtil; import neatlogic.framework.util.TableResultUtil; -import neatlogic.module.deploy.dao.mapper.DeployAppConfigMapper; -import neatlogic.module.deploy.dao.mapper.DeployJobMapper; -import neatlogic.module.deploy.dao.mapper.DeploySqlMapper; -import neatlogic.module.deploy.dao.mapper.DeployVersionMapper; -import neatlogic.module.deploy.dao.mapper.DeployInstanceVersionMapper; +import neatlogic.module.deploy.dao.mapper.*; import neatlogic.module.deploy.util.DeployPipelineConfigManager; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -698,7 +694,28 @@ public class DeployJobSourceTypeHandler extends AutoexecJobSourceTypeHandlerBase //补充是否有资源锁 boolean isHasLock = GlobalLockHandlerFactory.getHandler(JobSourceType.DEPLOY.getValue()).getIsHasLockByKey(result); result.put("isHasLock", isHasLock ? 1 : 0); - + // 判断当前用户是否拥有“版本&制品管理”权限 + boolean hasOperationVersionAndProductManagerAuth = false; + if (AuthActionChecker.check(DEPLOY_MODIFY.class)) { + hasOperationVersionAndProductManagerAuth = true; + } else { + AuthenticationInfoVo authenticationInfoVo = UserContext.get().getAuthenticationInfoVo(); + List authUuidList = new ArrayList<>(); + authUuidList.add(authenticationInfoVo.getUserUuid()); + authUuidList.addAll(authenticationInfoVo.getTeamUuidList()); + authUuidList.addAll(authenticationInfoVo.getRoleUuidList()); + List actionList = deployAppConfigMapper.getDeployAppAllAuthorityActionListByAppSystemIdAndAuthUuidList(deployJobVo.getAppSystemId(), authUuidList); + for (DeployAppConfigAuthorityActionVo actionVo : actionList) { + if (Objects.equals(actionVo.getType(), DeployAppConfigActionType.OPERATION.getValue())) { + if (Objects.equals(actionVo.getAction(), "all") + || Objects.equals(actionVo.getAction(), DeployAppConfigAction.VERSION_AND_PRODUCT_MANAGER.getValue())) { + hasOperationVersionAndProductManagerAuth = true; + break; + } + } + } + } + result.put("hasOperationVersionAndProductManagerAuth", hasOperationVersionAndProductManagerAuth); } return result; } -- Gitee