From e788bcaabeb96ae933e9e574fe4ba62e9ac62679 Mon Sep 17 00:00:00 2001 From: Finley Ge <32237950+FinleyGe@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:11:54 +0800 Subject: [PATCH] fix: only owner or team owner can change app's owner (#3033) --- projects/app/src/pages/app/list/components/List.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/projects/app/src/pages/app/list/components/List.tsx b/projects/app/src/pages/app/list/components/List.tsx index 2dbef7ae1..a1a3509be 100644 --- a/projects/app/src/pages/app/list/components/List.tsx +++ b/projects/app/src/pages/app/list/components/List.tsx @@ -409,12 +409,13 @@ const ListItem = () => { )} {!!editPerApp && ( - changeOwner({ - appId: editPerApp._id, - ownerId: tmbId - }).then(() => loadMyApps()) - } + {...(editPerApp.permission.isOwner && { + onChangeOwner: (tmbId: string) => + changeOwner({ + appId: editPerApp._id, + ownerId: tmbId + }).then(() => loadMyApps()) + })} refetchResource={loadMyApps} hasParent={Boolean(parentId)} resumeInheritPermission={onResumeInheritPermission}