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)
|
reject(error)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if ('listConfigurations' in store.getters.apis) {
|
||||||
api('listConfigurations', { name: 'hypervisor.custom.display.name' }).then(json => {
|
api('listConfigurations', { name: 'hypervisor.custom.display.name' }).then(json => {
|
||||||
if (json.listconfigurationsresponse.configuration !== null) {
|
if (json.listconfigurationsresponse.configuration !== null) {
|
||||||
const config = json.listconfigurationsresponse.configuration[0]
|
const config = json.listconfigurationsresponse.configuration[0]
|
||||||
|
|
@ -547,6 +548,7 @@ const user = {
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
UpdateConfiguration ({ commit }) {
|
UpdateConfiguration ({ commit }) {
|
||||||
|
|
|
||||||
|
|
@ -646,6 +646,9 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fetchCustomHypervisorName () {
|
fetchCustomHypervisorName () {
|
||||||
|
if (!('listConfigurations' in this.$store.getters.apis)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const params = {
|
const params = {
|
||||||
name: 'hypervisor.custom.display.name'
|
name: 'hypervisor.custom.display.name'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue