mirror of https://github.com/apache/cloudstack.git
ui: prevent calling listConfigurations when not allowed (#11704)
By default, normal users won't have access to listConfigurations API, therefore, UI should not call it when access is not there. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
db1c7d678c
commit
0e6d2d986b
|
|
@ -539,6 +539,7 @@ const user = {
|
|||
reject(error)
|
||||
})
|
||||
|
||||
if ('listConfigurations' in store.getters.apis) {
|
||||
api('listConfigurations', { name: 'hypervisor.custom.display.name' }).then(json => {
|
||||
if (json.listconfigurationsresponse.configuration !== null) {
|
||||
const config = json.listconfigurationsresponse.configuration[0]
|
||||
|
|
@ -547,6 +548,7 @@ const user = {
|
|||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
UpdateConfiguration ({ commit }) {
|
||||
|
|
|
|||
|
|
@ -646,6 +646,9 @@ export default {
|
|||
})
|
||||
},
|
||||
fetchCustomHypervisorName () {
|
||||
if (!('listConfigurations' in this.$store.getters.apis)) {
|
||||
return
|
||||
}
|
||||
const params = {
|
||||
name: 'hypervisor.custom.display.name'
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue