diff --git a/ui/src/config/section/image.js b/ui/src/config/section/image.js index e36fafdea16..cba21248ded 100644 --- a/ui/src/config/section/image.js +++ b/ui/src/config/section/image.js @@ -104,7 +104,13 @@ export default { icon: 'share-alt', label: 'label.action.template.share', dataView: true, - args: ['ispublic', 'isfeatured', 'isextractable'], + args: (record, store) => { + const fields = ['isfeatured', 'isextractable'] + if (['Admin'].includes(store.userInfo.roletype) || store.features.userpublictemplateenabled) { + fields.unshift('ispublic') + } + return fields + }, show: (record, store) => { return (['Admin'].includes(store.userInfo.roletype) || // If admin or owner or belongs to current project (record.domainid === store.userInfo.domainid && record.account === store.userInfo.account) || @@ -225,7 +231,13 @@ export default { icon: 'share-alt', label: 'label.action.iso.share', dataView: true, - args: ['ispublic', 'isfeatured', 'isextractable'], + args: (record, store) => { + const fields = ['isfeatured', 'isextractable'] + if (['Admin'].includes(store.userInfo.roletype) || store.features.userpublictemplateenabled) { + fields.unshift('ispublic') + } + return fields + }, show: (record, store) => { return (['Admin'].includes(store.userInfo.roletype) || // If admin or owner or belongs to current project (record.domainid === store.userInfo.domainid && record.account === store.userInfo.account) || diff --git a/ui/src/views/image/RegisterOrUploadIso.vue b/ui/src/views/image/RegisterOrUploadIso.vue index 8b8d5ba2e3b..8c75a581462 100644 --- a/ui/src/views/image/RegisterOrUploadIso.vue +++ b/ui/src/views/image/RegisterOrUploadIso.vue @@ -131,7 +131,9 @@ }]" /> - + - - {{ $t('label.ispublic') }} + + {{ $t('label.requireshvm') }} @@ -351,8 +351,10 @@ - - {{ $t('label.requireshvm') }} + + {{ $t('label.ispublic') }}