From cbe641d72623282856c6abf9893c15d0a3bfe197 Mon Sep 17 00:00:00 2001 From: wangyu096 Date: Mon, 28 Aug 2023 12:24:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=9C=E4=B8=9A=E6=A8=A1=E6=9D=BF-?= =?UTF-8?q?=E8=B0=83=E8=AF=95-=E5=8E=BB=E6=89=A7=E8=A1=8C=E7=9A=84?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=9D=83=E9=99=90=E8=B7=B3=E8=BD=AC=E9=A1=B5?= =?UTF-8?q?Bad=20Request=20#2359?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/web/impl/WebTaskPlanResourceImpl.java | 3 ++- .../bk/job/manage/auth/TemplateAuthService.java | 12 ------------ .../manage/auth/impl/TemplateAuthServiceImpl.java | 13 ------------- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/api/web/impl/WebTaskPlanResourceImpl.java b/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/api/web/impl/WebTaskPlanResourceImpl.java index 5fc2d8c260..f70abcd381 100644 --- a/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/api/web/impl/WebTaskPlanResourceImpl.java +++ b/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/api/web/impl/WebTaskPlanResourceImpl.java @@ -455,7 +455,8 @@ public Response savePlan(String username, AuthResult authResult; if (planId > 0) { if (planService.isDebugPlan(appResourceScope.getAppId(), templateId, planId)) { - authResult = templateAuthService.authDebugJobTemplate(username, appResourceScope, templateId); + // 调试作业模版会保存一份内置的执行方案;从用户角度来说仍然还是在处理跟模版相关的操作,所以使用模版查看鉴权 + authResult = templateAuthService.authViewJobTemplate(username, appResourceScope, templateId); } else { authResult = planAuthService.authEditJobPlan(username, appResourceScope, templateId, planId, null); diff --git a/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/auth/TemplateAuthService.java b/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/auth/TemplateAuthService.java index b1f103b22e..02ca79ab3d 100644 --- a/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/auth/TemplateAuthService.java +++ b/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/auth/TemplateAuthService.java @@ -80,18 +80,6 @@ AuthResult authDeleteJobTemplate(String username, AppResourceScope appResourceScope, Long jobTemplateId); - /** - * 资源范围下调试作业模板鉴权 - * - * @param username 用户名 - * @param appResourceScope 资源范围 - * @param jobTemplateId 作业模板ID - * @return 鉴权结果 - */ - AuthResult authDebugJobTemplate(String username, - AppResourceScope appResourceScope, - Long jobTemplateId); - /** * 资源范围下查看作业模板批量鉴权 * diff --git a/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/auth/impl/TemplateAuthServiceImpl.java b/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/auth/impl/TemplateAuthServiceImpl.java index d2408aa32e..693149646c 100644 --- a/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/auth/impl/TemplateAuthServiceImpl.java +++ b/src/backend/job-manage/service-job-manage/src/main/java/com/tencent/bk/job/manage/auth/impl/TemplateAuthServiceImpl.java @@ -107,19 +107,6 @@ public AuthResult authDeleteJobTemplate(String username, ); } - @Override - public AuthResult authDebugJobTemplate(String username, - AppResourceScope appResourceScope, - Long jobTemplateId) { - return authService.auth( - username, - ActionId.DEBUG_JOB_TEMPLATE, - ResourceTypeEnum.TEMPLATE, - jobTemplateId.toString(), - buildAppScopePath(appResourceScope) - ); - } - @Override public List batchAuthViewJobTemplate(String username, AppResourceScope appResourceScope,