perf: 优化全局组织下权限

This commit is contained in:
“huailei000”
2023-02-23 11:01:34 +08:00
committed by huailei
parent 4b7b3b3507
commit a851ccdfe7
3 changed files with 6 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ export default {
hasMoreActions: false,
createRoute: 'CommandFilterAclCreate',
canCreate: () => {
return this.$hasPerm('acls.add_commandfilteracl')
return this.$hasPerm('acls.add_commandfilteracl') && !this.$store.getters.currentOrgIsRoot
}
}
}

View File

@@ -46,7 +46,7 @@ export default {
hasMoreActions: false,
createRoute: 'CommandGroupCreate',
canCreate: () => {
return this.$hasPerm('acls.add_commandgroup')
return this.$hasPerm('acls.add_commandgroup') && !this.$store.getters.currentOrgIsRoot
}
}
}

View File

@@ -73,7 +73,8 @@ export default {
label: this.$t('assets.Refresh'),
disabled: !vm.$hasPerm('assets.refresh_assethardwareinfo') ||
!this.object['auto_info'].gather_facts_enabled ||
!this.object['auto_info'].ansible_enabled
!this.object['auto_info'].ansible_enabled ||
this.$store.getters.currentOrgIsRoot
},
callbacks: {
click: function() {
@@ -94,7 +95,8 @@ export default {
label: this.$t('assets.Test'),
disabled: !vm.$hasPerm('assets.test_assetconnectivity') ||
!this.object['auto_info'].ansible_enabled ||
!this.object['auto_info']['ping_enabled']
!this.object['auto_info']['ping_enabled'] ||
this.$store.getters.currentOrgIsRoot
},
callbacks: {
click: function() {