perf: Pam rbac

This commit is contained in:
feng
2025-08-18 17:38:54 +08:00
committed by feng626
parent 0a58c4bbcc
commit ff122acca0
4 changed files with 35 additions and 16 deletions

View File

@@ -37,7 +37,7 @@ export default {
attrs: {
type: 'primary',
label: this.$t('Execute'),
disabled: !this.$hasPerm('accounts.add_checkaccountautomation') || !this.object.is_active
disabled: !this.$hasPerm('accounts.add_checkaccountexecution') || !this.object.is_active
},
callbacks: {
click: function() {

View File

@@ -232,16 +232,18 @@ export default {
this.chart = echarts.init(this.$refs.chartRef)
this.chart.setOption(this.chartOption)
this.chart.on('click', (params) => {
if (params.componentType === 'series') {
this.$router.push({
name: 'AccountCheckList',
query: {
payload: params.data.description
}
})
}
})
if (this.$hasPerm('accounts.view_accountrisk')) {
this.chart.on('click', (params) => {
if (params.componentType === 'series') {
this.$router.push({
name: 'AccountCheckList',
query: {
payload: params.data.description
}
})
}
})
}
},
updateChart() {
if (this.chart) {

View File

@@ -26,7 +26,7 @@
v-for="item in summaryItems"
:key="item.key"
class="metric-item"
@click="handleClick(item)"
@click="!item.disabled && handleClick(item)"
>
<span class="metric-label">{{ $tc(item.label) }}</span>
<span class="metric-value" :class="{'increase': config[item.key] > 0}">
@@ -56,19 +56,23 @@ export default {
summaryItems: [
{
label: this.$t('Privileged'),
key: 'privileged'
key: 'privileged',
disabled: !this.$hasPerm('accounts.view_account')
},
{
label: this.$t('ResetSecret'),
key: 'resetSecret'
key: 'resetSecret',
disabled: !this.$hasPerm('accounts.view_account')
},
{
label: this.$t('Connectable'),
key: 'connectable'
key: 'connectable',
disabled: !this.$hasPerm('accounts.view_account')
},
{
label: this.$t('Active'),
key: 'is_active'
key: 'is_active',
disabled: !this.$hasPerm('accounts.view_account')
}
]
}

View File

@@ -110,6 +110,19 @@ export default {
'acls.loginassetacl': ['users.view_user'],
'acls.commandfilteracl': ['users.view_user'],
'assets.view_asset': ['assets.view_platform'],
'accounts.view_checkaccountexecution': ['accounts.view_checkaccountautomation'],
'accounts.add_checkaccountexecution': ['accounts.view_checkaccountautomation'],
'accounts.view_changesecretexecution': ['accounts.view_changesecretautomation'],
'accounts.add_changesecretexecution': ['accounts.view_changesecretautomation'],
'accounts.view_changesecretrecord': ['accounts.view_changesecretautomation'],
'accounts.view_pushaccountexecution': ['accounts.view_pushaccountautomation'],
'accounts.add_pushaccountexecution': ['accounts.view_pushaccountautomation'],
'accounts.view_pushsecretrecord': ['accounts.view_pushaccountautomation'],
'accounts.view_backupaccountexecution': ['accounts.view_backupaccountautomation'],
'accounts.add_backupaccountexecution': ['accounts.view_backupaccountautomation'],
'accounts.view_gatheraccountsexecution': ['accounts.view_gatheraccountsautomation'],
'accounts.add_gatheraccountsexecution': ['accounts.view_gatheraccountsautomation'],
'accounts.view_gatheraccountsautomation': ['accounts.view_gatheredaccount'],
'assets.view_node': ['assets.view_asset', 'assets.view_platform'],
'acls.commandgroup': ['acls.view_commandfilteracl'],
'assets.gateway': ['assets.view_zone'],