From 38c76d0a59ad056ee1c1eb757c6ed053c4be51b2 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Thu, 17 Mar 2022 17:47:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=97=AE=E9=A2=98=EF=BC=88=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E7=BB=84=E7=BB=87=EF=BC=89=EF=BC=9B=E4=BF=AE=E5=A4=8D=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E8=AF=A6=E6=83=85=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/Asset/AssetDetail/SystemUser.vue | 15 ++++++++++----- src/views/settings/Org/OrganizationList.vue | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/views/assets/Asset/AssetDetail/SystemUser.vue b/src/views/assets/Asset/AssetDetail/SystemUser.vue index 1d7bf8797..b3008eb05 100644 --- a/src/views/assets/Asset/AssetDetail/SystemUser.vue +++ b/src/views/assets/Asset/AssetDetail/SystemUser.vue @@ -65,6 +65,7 @@ export default { name: 'Test', title: this.$t('common.Test'), type: 'primary', + can: vm.$hasPerm('assets.test_assetconnectivity'), callback: ({ row }) => { const theUrl = `/api/v1/assets/system-users/${row.systemuser}/tasks/` const data = { action: 'test', assets: [this.object.id] } @@ -76,6 +77,7 @@ export default { { name: 'Push', title: this.$t('common.Push'), + can: vm.$hasPerm('assets.push_assetsystemuser'), type: 'primary', callback: ({ row }) => { const theUrl = `/api/v1/assets/system-users/${row.systemuser}/tasks/` @@ -89,7 +91,7 @@ export default { name: 'Delete', title: this.$t('common.Delete'), type: 'danger', - can: !this.$store.getters.currentOrgIsRoot, + can: !this.$store.getters.currentOrgIsRoot && vm.$hasPerm('assets.delete_authbook'), callback: (val) => { this.$axios.delete(`/api/v1/assets/system-users-assets-relations/${val.row.id}/`).then(() => { this.$message.success(this.$t('common.deleteSuccessMsg')) @@ -111,7 +113,7 @@ export default { title: this.$t('common.TestSelectedSystemUsersConnective'), name: 'TestSelected', can({ selectedRows }) { - return selectedRows.length > 0 + return selectedRows.length > 0 && vm.$hasPerm('assets.test_assetconnectivity') }, callback: this.bulkTestCallback.bind(this) }, @@ -119,7 +121,7 @@ export default { title: this.$t('common.PushSelectedSystemUsersToAsset'), name: 'PushSelected', can({ selectedRows }) { - return selectedRows.length > 0 + return selectedRows.length > 0 && vm.$hasPerm('assets.push_assetsystemuser') }, callback: this.bulkPushCallback.bind(this) } @@ -130,7 +132,8 @@ export default { title: this.$t('assets.TestAllSystemUsersConnective'), attrs: { type: 'primary', - label: this.$t('common.Test') + label: this.$t('common.Test'), + disabled: !vm.$hasPerm('assets.test_assetconnectivity') }, callbacks: { click: function() { @@ -146,7 +149,8 @@ export default { title: this.$t('assets.PushAllSystemUsersToAsset'), attrs: { type: 'primary', - label: this.$t('common.Push') + label: this.$t('common.Push'), + disabled: !vm.$hasPerm('assets.push_assetsystemuser') }, callbacks: { click: function({ row }) { @@ -160,6 +164,7 @@ export default { } ], systemUserRelationConfig: { + disabled: !vm.$hasPerm('assets.add_authbook'), icon: 'fa-link', type: 'info', title: this.$t('assets.AssociateSystemUsers'), diff --git a/src/views/settings/Org/OrganizationList.vue b/src/views/settings/Org/OrganizationList.vue index f58cdcc9c..376a566d8 100644 --- a/src/views/settings/Org/OrganizationList.vue +++ b/src/views/settings/Org/OrganizationList.vue @@ -91,6 +91,7 @@ export default { } }, headerActions: { + canCreate: this.$hasPerm('orgs.add_organization'), hasExport: false, hasImport: false, hasMoreActions: false