fix: 修复作业中心-任务列表路由权限不准确问题

This commit is contained in:
“huailei000”
2022-03-14 20:26:32 +08:00
committed by 老广
parent 3ea1353101
commit df228f5256
3 changed files with 16 additions and 4 deletions

View File

@@ -28,14 +28,22 @@ export default [
component: () => import('@/views/ops/TaskDetail/AdhocDetail'),
name: 'AdhocDetail',
hidden: true,
meta: { title: i18n.t('route.TaskDetail'), activeMenu: '/console/ops/tasks' }
meta: {
title: i18n.t('route.TaskDetail'),
permissions: ['ops.view_adhoc'],
activeMenu: '/ops/tasks'
}
},
{
path: 'executions/:id',
component: () => import('@/views/ops/TaskDetail/HistoryExecutionDetail'),
name: 'HistoryExecutionDetail',
hidden: true,
meta: { title: i18n.t('route.TaskDetail'), activeMenu: '/console/ops/tasks' }
meta: {
title: i18n.t('route.TaskDetail'),
permissions: ['ops.view_adhocexecution'],
activeMenu: '/console/ops/tasks'
}
},
{
path: 'command-executions/create',
@@ -43,6 +51,7 @@ export default [
component: () => import('@/views/ops/CommandExecution'),
meta: {
title: i18n.t('route.BatchCommand'),
permissions: ['ops.add_adhocexecution'],
hidden: ({ settings }) => !settings['SECURITY_COMMAND_EXECUTION']
}
},

View File

@@ -67,6 +67,9 @@ export default {
value: this.object.latest_execution,
formatter: function(row, data) {
const route = { to: { name: 'AdhocDetail', params: { id: data.adhoc }}}
if (!this.$hasPerm('ops.ops.view_adhoc')) {
return <span>{ data.adhoc_short_id }</span>
}
return <router-link {...{ attrs: route }}>{ data.adhoc_short_id }</router-link>
}
},

View File

@@ -34,12 +34,12 @@ export default {
{
title: this.$t('ops.taskVersions'),
name: 'TaskAdhoc',
hidden: () => !this.$hasPerm('ops.view_task')
hidden: () => !this.$hasPerm('ops.view_adhoc')
},
{
title: this.$t('ops.execution'),
name: 'TaskHistory',
hidden: () => !this.$hasPerm('ops.view_taskmonitor')
hidden: () => !this.$hasPerm('ops.view_adhocexecution')
}
],
hasRightSide: false