mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-25 14:34:46 +00:00
perf: Rbac pam
This commit is contained in:
@@ -119,10 +119,10 @@ export function getPermedViews() {
|
||||
const viewShowMapper = [
|
||||
['console', store.getters.consoleOrgs.length > 0],
|
||||
['audit', store.getters.auditOrgs.length > 0],
|
||||
['pam', store.getters.pamOrgs.length > 0],
|
||||
['workbench', true],
|
||||
['tickets', hasPermission('tickets.view_ticket')],
|
||||
['settings', hasPermission('settings.view_setting')],
|
||||
['pam', store.getters.consoleOrgs.length > 0]
|
||||
['settings', hasPermission('settings.view_setting')]
|
||||
]
|
||||
return viewShowMapper.filter(i => i[1]).map(i => i[0])
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ export async function checkUserFirstLogin({ to, from, next }) {
|
||||
export async function changeCurrentViewIfNeed({ to, from, next }) {
|
||||
let viewName = to.path.split('/')[1]
|
||||
// 这几个是需要检测的, 切换视图组织时,避免 404, 这里不能加 settings, 因为 默认没有返回 setting 组织(System) 的管理权限
|
||||
if (['console', 'audit', 'workbench', 'tickets', 'pam', ''].indexOf(viewName) === -1) {
|
||||
if (['console', 'audit', 'pam', 'workbench', 'tickets', ''].indexOf(viewName) === -1) {
|
||||
Vue.$log.debug('Current view no need check', viewName)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user