feat: Resource permission in system-manage
This commit is contained in:
parent
6adc051cad
commit
b3fa1e559a
@ -1,6 +1,5 @@
|
|||||||
import {hasPermission} from '@/utils/permission/index'
|
import {hasPermission} from '@/utils/permission/index'
|
||||||
import {ComplexPermission} from '@/utils/permission/type'
|
import {PermissionConst, RoleConst} from '@/utils/permission/data'
|
||||||
import {EditionConst, PermissionConst, RoleConst} from '@/utils/permission/data'
|
|
||||||
|
|
||||||
const systemManage = {
|
const systemManage = {
|
||||||
create: () => false,
|
create: () => false,
|
||||||
|
|||||||
@ -13,29 +13,128 @@ const systemManage = {
|
|||||||
'OR',
|
'OR',
|
||||||
),
|
),
|
||||||
create: () => false,
|
create: () => false,
|
||||||
sync: () => false,
|
sync: () => hasPermission(
|
||||||
vector: () => false,
|
[
|
||||||
generate: () => false,
|
RoleConst.ADMIN,
|
||||||
edit: () => false,
|
PermissionConst.RESOURCE_KNOWLEDGE_SYNC
|
||||||
export: () => false,
|
],'OR'
|
||||||
delete: () => false,
|
),
|
||||||
|
vector: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_VECTOR
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
generate: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_GENERATE
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
edit: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_EDIT
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
export: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_EXPORT
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
delete: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_DELETE
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
// 文档
|
||||||
|
doc_create: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_DOCUMENT_CREATE
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
doc_vector: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_DOCUMENT_VECTOR
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
doc_generate: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_DOCUMENT_GENERATE
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
doc_migrate: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_DOCUMENT_MIGRATE
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
doc_edit: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_DOCUMENT_EDIT
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
doc_sync: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_DOCUMENT_SYNC
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
doc_delete: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_DOCUMENT_DELETE
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
doc_export: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_DOCUMENT_EXPORT
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
doc_download: () => hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_DOCUMENT_DOWNLOAD_SOURCE_FILE
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
|
||||||
doc_create: () => false,
|
knowledge_chat_user_edit: () =>
|
||||||
doc_vector: () => false,
|
hasPermission([
|
||||||
doc_generate: () => false,
|
RoleConst.ADMIN,
|
||||||
doc_migrate: () => false,
|
PermissionConst.RESOURCE_KNOWLEDGE_CHAT_USER_EDIT
|
||||||
doc_edit: () => false,
|
],'OR'),
|
||||||
doc_sync: () => false,
|
|
||||||
doc_delete: () => false,
|
|
||||||
doc_export: () => false,
|
|
||||||
doc_download: () => false,
|
|
||||||
|
|
||||||
knowledge_chat_user_edit: () => false,
|
problem_create: () =>
|
||||||
|
hasPermission([
|
||||||
problem_create: () => false,
|
RoleConst.ADMIN,
|
||||||
problem_relate: () => false,
|
PermissionConst.RESOURCE_KNOWLEDGE_PROBLEM_CREATE
|
||||||
problem_delete: () => false,
|
],'OR'
|
||||||
problem_edit: () => false,
|
),
|
||||||
|
problem_relate: () =>
|
||||||
|
hasPermission([
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_PROBLEM_RELATE
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
problem_delete: () =>
|
||||||
|
hasPermission([
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_PROBLEM_DELETE
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
problem_edit: () =>
|
||||||
|
hasPermission([
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_KNOWLEDGE_PROBLEM_EDIT
|
||||||
|
],'OR'
|
||||||
|
),
|
||||||
|
|
||||||
folderCreate: () => false,
|
folderCreate: () => false,
|
||||||
folderEdit: () => false,
|
folderEdit: () => false,
|
||||||
|
|||||||
@ -13,9 +13,21 @@ const systemManage = {
|
|||||||
'OR',
|
'OR',
|
||||||
),
|
),
|
||||||
create: () => false,
|
create: () => false,
|
||||||
modify: () => false,
|
modify: () =>
|
||||||
paramSetting: () => false,
|
hasPermission([
|
||||||
delete: () => false,
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_MODEL_EDIT
|
||||||
|
],'OR'),
|
||||||
|
paramSetting: () =>
|
||||||
|
hasPermission([
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_MODEL_EDIT
|
||||||
|
],'OR'),
|
||||||
|
delete: () =>
|
||||||
|
hasPermission([
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_MODEL_DELETE
|
||||||
|
],'OR'),
|
||||||
|
|
||||||
folderCreate: () => false,
|
folderCreate: () => false,
|
||||||
folderEdit: () => false,
|
folderEdit: () => false,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user