Skip to content

Commit b0c7719

Browse files
authored
ui: do not show admin only options to users while registering template (#11702)
1 parent e78b5cc commit b0c7719

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ui/src/views/image/RegisterOrUploadTemplate.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,9 @@ export default {
685685
})
686686
},
687687
fetchCustomHypervisorName () {
688+
if (!('listConfigurations' in store.getters.apis)) {
689+
return
690+
}
688691
const params = {
689692
name: 'hypervisor.custom.display.name'
690693
}
@@ -702,6 +705,9 @@ export default {
702705
})
703706
},
704707
fetchExtensionsList () {
708+
if (!this.isAdminRole) {
709+
return
710+
}
705711
this.loading = true
706712
getAPI('listExtensions', {
707713
}).then(response => {
@@ -758,6 +764,9 @@ export default {
758764
name: 'Simulator'
759765
})
760766
}
767+
if (!this.isAdminRole) {
768+
listhyperVisors = listhyperVisors.filter(hv => hv.name !== 'External')
769+
}
761770
this.hyperVisor.opts = listhyperVisors
762771
}).finally(() => {
763772
this.hyperVisor.loading = false

0 commit comments

Comments
 (0)