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 && (
<ConfigPerModal
onChangeOwner={(tmbId: string) =>
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}