mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-13 11:24:17 +00:00
fix: 优化权限树(1)
This commit is contained in:
@@ -14,7 +14,7 @@ export default {
|
||||
title: i18n.t('common.nav.Audits'),
|
||||
icon: 'el-icon-s-claim',
|
||||
showNavSwitcher: true,
|
||||
permissions: ['rbac.view_auditview'],
|
||||
permissions: ['rbac.view_audit'],
|
||||
view: 'audit'
|
||||
},
|
||||
children: [
|
||||
@@ -24,7 +24,7 @@ export default {
|
||||
name: 'AuditDashboard',
|
||||
meta: {
|
||||
icon: 'dashboard',
|
||||
title: i18n.t('route.Overview'),
|
||||
title: i18n.t('route.Dashboard'),
|
||||
permissions: [],
|
||||
resource: 'common',
|
||||
app: 'common'
|
||||
|
||||
@@ -21,7 +21,7 @@ export default {
|
||||
view: 'console',
|
||||
type: 'view',
|
||||
showNavSwitcher: true,
|
||||
permissions: ['rbac.view_adminview']
|
||||
permissions: ['rbac.view_console']
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
name: 'AdminDashboard',
|
||||
meta: {
|
||||
icon: 'dashboard',
|
||||
title: i18n.t('route.Overview'),
|
||||
title: i18n.t('route.Dashboard'),
|
||||
permissions: []
|
||||
}
|
||||
},
|
||||
|
||||
@@ -15,7 +15,7 @@ export default {
|
||||
icon: 'el-icon-user-solid',
|
||||
showNavSwitcher: true,
|
||||
showOrganization: true,
|
||||
permissions: ['rbac.view_userview']
|
||||
permissions: ['rbac.view_workspace']
|
||||
},
|
||||
children: [
|
||||
// 404 page must be placed at the end !!!
|
||||
|
||||
@@ -80,9 +80,9 @@ export function hasActionPerm(route, action) {
|
||||
}
|
||||
|
||||
const viewRequirePermsMapper = {
|
||||
console: 'rbac.view_adminview',
|
||||
audit: 'rbac.view_auditview',
|
||||
workspace: 'rbac.view_userview'
|
||||
console: 'rbac.view_console',
|
||||
audit: 'rbac.view_audit',
|
||||
workspace: 'rbac.view_workspace'
|
||||
}
|
||||
|
||||
export function getViewRequirePerms(view) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Page>
|
||||
<div v-if="$hasPerm('rbac.view_resourcestatistics')">
|
||||
<div v-if="$hasPerm('rbac.view_dashboard')">
|
||||
<Announcement />
|
||||
<ResourceSummary />
|
||||
<DatesLoginSummary />
|
||||
|
||||
@@ -73,9 +73,9 @@ export default {
|
||||
}
|
||||
},
|
||||
viewPermMapper: [
|
||||
['view_console', ['rbac.view_adminview', 'rbac.view_resourcestatistics']],
|
||||
['view_audit', ['rbac.view_auditview', 'rbac.view_resourcestatistics']],
|
||||
['view_workspace', ['rbac.view_userview']]
|
||||
['view_console', ['rbac.view_console', 'rbac.view_dashboard']],
|
||||
['view_audit', ['rbac.view_audit', 'rbac.view_dashboard']],
|
||||
['view_workspace', ['rbac.view_workspace']]
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -209,7 +209,15 @@ export default {
|
||||
const ztree = this.$refs.tree.zTree
|
||||
const checkedNodes = ztree.getCheckedNodes()
|
||||
const permNodes = checkedNodes.filter(node => !node.isParent)
|
||||
const permIds = permNodes.map(node => node.id)
|
||||
const permIds = []
|
||||
for (const permNode of permNodes) {
|
||||
let id = permNode.id
|
||||
if (id.indexOf('#') !== -1) {
|
||||
id = id.split('#')[1]
|
||||
}
|
||||
permIds.push((id))
|
||||
}
|
||||
// const permIds = permNodes.map(node => node.id)
|
||||
|
||||
const roleDetailUrl = `/api/v1/rbac/${this.object.scope}-roles/${this.object.id}/`
|
||||
const data = {
|
||||
|
||||
Reference in New Issue
Block a user