File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 <a-button
2727 type =" dashed"
2828 style =" width : 100% "
29- :disabled =" !('updateTemplate' in $store.getters.apis && 'updateVirtualMachine' in $store.getters.apis && isAdminOrOwner ())"
29+ :disabled =" !(isAdminOrOwner() && hasSettingUpdatePermission ())"
3030 @click =" onShowAddDetail" >
3131 <template #icon ><plus-outlined /></template >
3232 {{ $t('label.add.setting') }}
9696 </a-list-item-meta >
9797 <template #actions >
9898 <div
99- v-if =" !disableSettings && 'updateTemplate' in $store.getters.apis &&
100- 'updateVirtualMachine' in $store.getters.apis && isAdminOrOwner() && allowEditOfDetail(item.name)" >
99+ v-if =" !disableSettings && isAdminOrOwner() && allowEditOfDetail(item.name) && hasSettingUpdatePermission()" >
101100 <tooltip-button
102101 :tooltip =" $t('label.edit')"
103102 icon =" edit-outlined"
106105 @onClick =" showEditDetail(index)" />
107106 </div >
108107 <div
109- v-if =" !disableSettings && 'updateTemplate' in $store.getters.apis &&
110- 'updateVirtualMachine' in $store.getters.apis && isAdminOrOwner() && allowEditOfDetail(item.name)" >
108+ v-if =" !disableSettings && isAdminOrOwner() && allowEditOfDetail(item.name) && hasSettingUpdatePermission()" >
111109 <a-popconfirm
112110 :title =" `${$t('label.delete.setting')}?`"
113111 @confirm =" deleteDetail(index)"
@@ -342,6 +340,12 @@ export default {
342340 this .newValue = ' '
343341 this .error = false
344342 this .showAddDetail = false
343+ },
344+ hasSettingUpdatePermission () {
345+ return (
346+ (this .resourceType === ' Template' && ' updateTemplate' in this .$store .getters .apis ) ||
347+ (this .resourceType === ' UserVm' && ' updateVirtualMachine' in this .$store .getters .apis )
348+ )
345349 }
346350 }
347351}
You can’t perform that action at this time.
0 commit comments