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:571
|
||||||
#: apps/resource_manage/views/document.py:585
|
#: apps/resource_manage/views/document.py:585
|
||||||
msgid "System Knowledge/Documentation"
|
msgid "System Knowledge/Documentation"
|
||||||
msgstr "知识库/文档"
|
msgstr "系统知识库/文档"
|
||||||
|
|
||||||
#: apps/resource_manage/views/document.py:51
|
#: apps/resource_manage/views/document.py:51
|
||||||
#: apps/resource_manage/views/document.py:52
|
#: 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:344
|
||||||
#: apps/resource_manage/views/paragraph.py:370
|
#: apps/resource_manage/views/paragraph.py:370
|
||||||
msgid "System Knowledge/Documentation/Paragraph"
|
msgid "System Knowledge/Documentation/Paragraph"
|
||||||
msgstr "知识库/文档/段落"
|
msgstr "系统知识库/文档/段落"
|
||||||
|
|
||||||
#: apps/resource_manage/views/paragraph.py:45
|
#: apps/resource_manage/views/paragraph.py:45
|
||||||
#: apps/resource_manage/views/paragraph.py:46
|
#: 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:158
|
||||||
#: apps/resource_manage/views/problem.py:182
|
#: apps/resource_manage/views/problem.py:182
|
||||||
msgid "System Knowledge/Documentation/Paragraph/Question"
|
msgid "System Knowledge/Documentation/Paragraph/Question"
|
||||||
msgstr "知识库/文档/段落/问题"
|
msgstr "系统知识库/文档/段落/问题"
|
||||||
|
|
||||||
#: apps/resource_manage/views/problem.py:44
|
#: apps/resource_manage/views/problem.py:44
|
||||||
#: apps/resource_manage/views/problem.py:45
|
#: 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:571
|
||||||
#: apps/resource_manage/views/document.py:585
|
#: apps/resource_manage/views/document.py:585
|
||||||
msgid "System Knowledge/Documentation"
|
msgid "System Knowledge/Documentation"
|
||||||
msgstr "知識庫/文檔"
|
msgstr "系統知識庫/文檔"
|
||||||
|
|
||||||
#: apps/resource_manage/views/document.py:51
|
#: apps/resource_manage/views/document.py:51
|
||||||
#: apps/resource_manage/views/document.py:52
|
#: 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:344
|
||||||
#: apps/resource_manage/views/paragraph.py:370
|
#: apps/resource_manage/views/paragraph.py:370
|
||||||
msgid "System Knowledge/Documentation/Paragraph"
|
msgid "System Knowledge/Documentation/Paragraph"
|
||||||
msgstr "知識庫/文檔/段落"
|
msgstr "系統知識庫/文檔/段落"
|
||||||
|
|
||||||
#: apps/resource_manage/views/paragraph.py:45
|
#: apps/resource_manage/views/paragraph.py:45
|
||||||
#: apps/resource_manage/views/paragraph.py:46
|
#: 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:158
|
||||||
#: apps/resource_manage/views/problem.py:182
|
#: apps/resource_manage/views/problem.py:182
|
||||||
msgid "System Knowledge/Documentation/Paragraph/Question"
|
msgid "System Knowledge/Documentation/Paragraph/Question"
|
||||||
msgstr "知識庫/文檔/段落/問題"
|
msgstr "系統知識庫/文檔/段落/問題"
|
||||||
|
|
||||||
#: apps/resource_manage/views/problem.py:44
|
#: apps/resource_manage/views/problem.py:44
|
||||||
#: apps/resource_manage/views/problem.py:45
|
#: apps/resource_manage/views/problem.py:45
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { hasPermission } from '@/utils/permission/index'
|
import {hasPermission} from '@/utils/permission/index'
|
||||||
import { ComplexPermission } from '@/utils/permission/type'
|
import {ComplexPermission} from '@/utils/permission/type'
|
||||||
import { EditionConst, PermissionConst, RoleConst } from '@/utils/permission/data'
|
import {EditionConst, PermissionConst, RoleConst} from '@/utils/permission/data'
|
||||||
|
|
||||||
const systemManage = {
|
const systemManage = {
|
||||||
is_share: () =>
|
is_share: () =>
|
||||||
hasPermission(
|
hasPermission(
|
||||||
@ -12,14 +13,49 @@ const systemManage = {
|
|||||||
),
|
),
|
||||||
'OR',
|
'OR',
|
||||||
),
|
),
|
||||||
delete: () => false,
|
delete: () =>
|
||||||
|
hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_TOOL_DELETE,
|
||||||
|
],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
create: () => false,
|
create: () => false,
|
||||||
import: () => false,
|
import: () => false,
|
||||||
switch: () => false,
|
switch: () =>
|
||||||
edit: () => false,
|
hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_TOOL_EDIT,
|
||||||
|
],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
edit: () =>
|
||||||
|
hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_TOOL_EDIT,
|
||||||
|
],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
copy: () => false,
|
copy: () => false,
|
||||||
export: () => false,
|
export: () =>
|
||||||
debug: () => false,
|
hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_TOOL_EXPORT,
|
||||||
|
],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
debug: () =>
|
||||||
|
hasPermission(
|
||||||
|
[
|
||||||
|
RoleConst.ADMIN,
|
||||||
|
PermissionConst.RESOURCE_TOOL_DEBUG,
|
||||||
|
],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
|
||||||
folderCreate: () => false,
|
folderCreate: () => false,
|
||||||
folderEdit: () => false,
|
folderEdit: () => false,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user