1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

F OpenNebula/one#6331: Disable change owner & group UI (#2754)

This commit is contained in:
vichansson 2023-09-25 20:52:51 +03:00 committed by GitHub
parent 598e0bc91c
commit a8b1e4ca5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -229,6 +229,8 @@ const Actions = () => {
selected: true,
color: 'secondary',
dataCy: 'marketapp-ownership',
disabled: (rows) =>
rows.some(({ original }) => original?.MARKETPLACE_ID === '0'),
options: [
{
accessor: MARKETPLACE_APP_ACTIONS.CHANGE_OWNER,

View File

@ -61,7 +61,8 @@ const MarketplaceAppInfoTab = ({ tabProps = {}, id }) => {
const [changePermissions] = useChangeAppPermissionsMutation()
const [updateTemplate] = useUpdateAppMutation()
const { data: app = {} } = useGetMarketplaceAppQuery({ id })
const { UNAME, UID, GNAME, GID, PERMISSIONS, TEMPLATE } = app
const { UNAME, UID, GNAME, GID, PERMISSIONS, MARKETPLACE_ID, TEMPLATE } = app
const isPublic = (MARKETID) => MARKETID === 0
const handleChangeOwnership = async (newOwnership) => {
await changeOwnership({ id, ...newOwnership })
@ -116,7 +117,7 @@ const MarketplaceAppInfoTab = ({ tabProps = {}, id }) => {
handleEdit={handleChangePermission}
/>
)}
{ownershipPanel?.enabled && (
{ownershipPanel?.enabled && !isPublic(MARKETPLACE_ID) && (
<Ownership
actions={getActions(ownershipPanel?.actions)}
userId={UID}