mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: enhance permission checks for delete, switch, edit, export, and debug operations
This commit is contained in:
parent
41cb4fedb1
commit
dc9ae84466
|
|
@ -5196,7 +5196,7 @@ msgstr "创建系统知识库"
|
|||
#: apps/resource_manage/views/document.py:571
|
||||
#: apps/resource_manage/views/document.py:585
|
||||
msgid "System Knowledge/Documentation"
|
||||
msgstr "知识库/文档"
|
||||
msgstr "系统知识库/文档"
|
||||
|
||||
#: apps/resource_manage/views/document.py:51
|
||||
#: apps/resource_manage/views/document.py:52
|
||||
|
|
@ -5445,7 +5445,7 @@ msgstr "段落列表"
|
|||
#: apps/resource_manage/views/paragraph.py:344
|
||||
#: apps/resource_manage/views/paragraph.py:370
|
||||
msgid "System Knowledge/Documentation/Paragraph"
|
||||
msgstr "知识库/文档/段落"
|
||||
msgstr "系统知识库/文档/段落"
|
||||
|
||||
#: apps/resource_manage/views/paragraph.py:45
|
||||
#: apps/resource_manage/views/paragraph.py:46
|
||||
|
|
@ -5532,7 +5532,7 @@ msgstr "问题列表"
|
|||
#: apps/resource_manage/views/problem.py:158
|
||||
#: apps/resource_manage/views/problem.py:182
|
||||
msgid "System Knowledge/Documentation/Paragraph/Question"
|
||||
msgstr "知识库/文档/段落/问题"
|
||||
msgstr "系统知识库/文档/段落/问题"
|
||||
|
||||
#: apps/resource_manage/views/problem.py:44
|
||||
#: apps/resource_manage/views/problem.py:45
|
||||
|
|
|
|||
|
|
@ -5196,7 +5196,7 @@ msgstr "創建系統知識庫"
|
|||
#: apps/resource_manage/views/document.py:571
|
||||
#: apps/resource_manage/views/document.py:585
|
||||
msgid "System Knowledge/Documentation"
|
||||
msgstr "知識庫/文檔"
|
||||
msgstr "系統知識庫/文檔"
|
||||
|
||||
#: apps/resource_manage/views/document.py:51
|
||||
#: apps/resource_manage/views/document.py:52
|
||||
|
|
@ -5445,7 +5445,7 @@ msgstr "段落列表"
|
|||
#: apps/resource_manage/views/paragraph.py:344
|
||||
#: apps/resource_manage/views/paragraph.py:370
|
||||
msgid "System Knowledge/Documentation/Paragraph"
|
||||
msgstr "知識庫/文檔/段落"
|
||||
msgstr "系統知識庫/文檔/段落"
|
||||
|
||||
#: apps/resource_manage/views/paragraph.py:45
|
||||
#: apps/resource_manage/views/paragraph.py:46
|
||||
|
|
@ -5532,7 +5532,7 @@ msgstr "問題列表"
|
|||
#: apps/resource_manage/views/problem.py:158
|
||||
#: apps/resource_manage/views/problem.py:182
|
||||
msgid "System Knowledge/Documentation/Paragraph/Question"
|
||||
msgstr "知識庫/文檔/段落/問題"
|
||||
msgstr "系統知識庫/文檔/段落/問題"
|
||||
|
||||
#: apps/resource_manage/views/problem.py:44
|
||||
#: apps/resource_manage/views/problem.py:45
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { hasPermission } from '@/utils/permission/index'
|
||||
import { ComplexPermission } from '@/utils/permission/type'
|
||||
import { EditionConst, PermissionConst, RoleConst } from '@/utils/permission/data'
|
||||
import {hasPermission} from '@/utils/permission/index'
|
||||
import {ComplexPermission} from '@/utils/permission/type'
|
||||
import {EditionConst, PermissionConst, RoleConst} from '@/utils/permission/data'
|
||||
|
||||
const systemManage = {
|
||||
is_share: () =>
|
||||
hasPermission(
|
||||
|
|
@ -12,14 +13,49 @@ const systemManage = {
|
|||
),
|
||||
'OR',
|
||||
),
|
||||
delete: () => false,
|
||||
delete: () =>
|
||||
hasPermission(
|
||||
[
|
||||
RoleConst.ADMIN,
|
||||
PermissionConst.RESOURCE_TOOL_DELETE,
|
||||
],
|
||||
'OR',
|
||||
),
|
||||
create: () => false,
|
||||
import: () => false,
|
||||
switch: () => false,
|
||||
edit: () => false,
|
||||
switch: () =>
|
||||
hasPermission(
|
||||
[
|
||||
RoleConst.ADMIN,
|
||||
PermissionConst.RESOURCE_TOOL_EDIT,
|
||||
],
|
||||
'OR',
|
||||
),
|
||||
edit: () =>
|
||||
hasPermission(
|
||||
[
|
||||
RoleConst.ADMIN,
|
||||
PermissionConst.RESOURCE_TOOL_EDIT,
|
||||
],
|
||||
'OR',
|
||||
),
|
||||
copy: () => false,
|
||||
export: () => false,
|
||||
debug: () => false,
|
||||
export: () =>
|
||||
hasPermission(
|
||||
[
|
||||
RoleConst.ADMIN,
|
||||
PermissionConst.RESOURCE_TOOL_EXPORT,
|
||||
],
|
||||
'OR',
|
||||
),
|
||||
debug: () =>
|
||||
hasPermission(
|
||||
[
|
||||
RoleConst.ADMIN,
|
||||
PermissionConst.RESOURCE_TOOL_DEBUG,
|
||||
],
|
||||
'OR',
|
||||
),
|
||||
|
||||
folderCreate: () => false,
|
||||
folderEdit: () => false,
|
||||
|
|
|
|||
Loading…
Reference in New Issue