mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix permission to manipulate VMs and templates settings through UI (#8778)
This commit is contained in:
parent
6502dde8c3
commit
582249c1f7
@ -26,7 +26,7 @@
|
||||
<a-button
|
||||
type="dashed"
|
||||
style="width: 100%"
|
||||
:disabled="!('updateTemplate' in $store.getters.apis && 'updateVirtualMachine' in $store.getters.apis && isAdminOrOwner())"
|
||||
:disabled="!(isAdminOrOwner() && hasSettingUpdatePermission())"
|
||||
@click="onShowAddDetail">
|
||||
<template #icon><plus-outlined /></template>
|
||||
{{ $t('label.add.setting') }}
|
||||
@ -96,8 +96,7 @@
|
||||
</a-list-item-meta>
|
||||
<template #actions>
|
||||
<div
|
||||
v-if="!disableSettings && 'updateTemplate' in $store.getters.apis &&
|
||||
'updateVirtualMachine' in $store.getters.apis && isAdminOrOwner() && allowEditOfDetail(item.name)">
|
||||
v-if="!disableSettings && isAdminOrOwner() && allowEditOfDetail(item.name) && hasSettingUpdatePermission()">
|
||||
<tooltip-button
|
||||
:tooltip="$t('label.edit')"
|
||||
icon="edit-outlined"
|
||||
@ -106,8 +105,7 @@
|
||||
@onClick="showEditDetail(index)" />
|
||||
</div>
|
||||
<div
|
||||
v-if="!disableSettings && 'updateTemplate' in $store.getters.apis &&
|
||||
'updateVirtualMachine' in $store.getters.apis && isAdminOrOwner() && allowEditOfDetail(item.name)">
|
||||
v-if="!disableSettings && isAdminOrOwner() && allowEditOfDetail(item.name) && hasSettingUpdatePermission()">
|
||||
<a-popconfirm
|
||||
:title="`${$t('label.delete.setting')}?`"
|
||||
@confirm="deleteDetail(index)"
|
||||
@ -342,6 +340,12 @@ export default {
|
||||
this.newValue = ''
|
||||
this.error = false
|
||||
this.showAddDetail = false
|
||||
},
|
||||
hasSettingUpdatePermission () {
|
||||
return (
|
||||
(this.resourceType === 'Template' && 'updateTemplate' in this.$store.getters.apis) ||
|
||||
(this.resourceType === 'UserVm' && 'updateVirtualMachine' in this.$store.getters.apis)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user