From 99d01eb605a442ecbe1d105fdd563149f24f3450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E9=BE=99=E9=BE=99?= Date: Mon, 13 Nov 2023 21:40:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(mis-web):=20=E4=BF=AE=E5=A4=8D=20scow=20?= =?UTF-8?q?=E4=BB=85=E5=8F=AF=E4=BB=A5=E6=8F=90=E4=BA=A4=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E7=94=A8=E6=88=B7=E6=9D=A5=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E4=BD=9C=E4=B8=9A=20(#972)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复 scow 管理系统仅可 以提交当前作业的用户来取消作业,考虑从 scow 做完全的鉴权,不放开适配器权限 slurm adapter 取消作业时会 `su userId scancel xxx`,所以不能提交执行当前操作的用户 id 来取消作业。 scow 会先校验当前用户的权限,如果具有取消用户作业的权限,则获取提交当前作业的用户,使用该用户 userId 来取消作业 --- .changeset/afraid-tips-hug.md | 5 +++++ apps/mis-web/src/pages/api/job/cancelJob.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/afraid-tips-hug.md diff --git a/.changeset/afraid-tips-hug.md b/.changeset/afraid-tips-hug.md new file mode 100644 index 0000000000..f5d09ef049 --- /dev/null +++ b/.changeset/afraid-tips-hug.md @@ -0,0 +1,5 @@ +--- +"@scow/mis-web": patch +--- + +适应 scow slurm 适配器仅可取消提交当前作业用户的作业 diff --git a/apps/mis-web/src/pages/api/job/cancelJob.ts b/apps/mis-web/src/pages/api/job/cancelJob.ts index a53a83948f..aabe6d826b 100644 --- a/apps/mis-web/src/pages/api/job/cancelJob.ts +++ b/apps/mis-web/src/pages/api/job/cancelJob.ts @@ -69,8 +69,9 @@ export default /* #__PURE__*/route(CancelJobSchema, async (req, res) => { }, }; + // Cancel the job for the user who submitted the job return asyncUnaryCall(client, "cancelJob", { - jobId: +jobId, userId: info.identityId, cluster, + jobId: +jobId, userId: job.user, cluster, }).then(async () => { await callLog(logInfo, OperationResult.SUCCESS); return { 204: null };