fix: only owner or team owner can change app's owner (#3033)

This commit is contained in:
Finley Ge
2024-10-30 19:11:54 +08:00
committed by GitHub
parent 9219903341
commit e788bcaabe

View File

@@ -409,12 +409,13 @@ const ListItem = () => {
)} )}
{!!editPerApp && ( {!!editPerApp && (
<ConfigPerModal <ConfigPerModal
onChangeOwner={(tmbId: string) => {...(editPerApp.permission.isOwner && {
changeOwner({ onChangeOwner: (tmbId: string) =>
appId: editPerApp._id, changeOwner({
ownerId: tmbId appId: editPerApp._id,
}).then(() => loadMyApps()) ownerId: tmbId
} }).then(() => loadMyApps())
})}
refetchResource={loadMyApps} refetchResource={loadMyApps}
hasParent={Boolean(parentId)} hasParent={Boolean(parentId)}
resumeInheritPermission={onResumeInheritPermission} resumeInheritPermission={onResumeInheritPermission}