diff --git a/apps/common/constants/permission_constants.py b/apps/common/constants/permission_constants.py index aa246b768..b3ab3e667 100644 --- a/apps/common/constants/permission_constants.py +++ b/apps/common/constants/permission_constants.py @@ -1179,7 +1179,10 @@ class PermissionConstants(Enum): group=Group.OPERATION_LOG, operate=Operate.READ, role_list=[RoleConstants.ADMIN], parent_group=[SystemGroup.OPERATION_LOG] ) - + OPERATION_LOG_EXPORT = Permission( + group=Group.OPERATION_LOG, operate=Operate.EXPORT, role_list=[RoleConstants.ADMIN], + parent_group=[SystemGroup.OPERATION_LOG] + ) def get_workspace_application_permission(self): return lambda r, kwargs: Permission(group=self.value.group, operate=self.value.operate, resource_path= diff --git a/ui/src/router/modules/system.ts b/ui/src/router/modules/system.ts index e897df431..56d9fd333 100644 --- a/ui/src/router/modules/system.ts +++ b/ui/src/router/modules/system.ts @@ -99,6 +99,7 @@ const systemRouter = { activeMenu: '/system', parentPath: '/system', parentName: 'system', + sameRoute: 'workspace', }, component: () => import('@/views/system-resource-management/KnowledgeResourceIndex.vue'), }, @@ -110,6 +111,7 @@ const systemRouter = { activeMenu: '/system', parentPath: '/system', parentName: 'system', + sameRoute: 'workspace', }, component: () => import('@/views/system-resource-management/ToolResourceIndex.vue'), }, @@ -222,7 +224,6 @@ const systemRouter = { activeMenu: '/system', parentPath: '/system', parentName: 'system', - sameRoute: 'chat', permission: [ new ComplexPermission( [RoleConst.WORKSPACE_MANAGE, RoleConst.ADMIN], @@ -241,6 +242,7 @@ const systemRouter = { activeMenu: '/system', parentPath: '/system', parentName: 'system', + sameRoute: 'SystemChat', permission: [ new ComplexPermission( [RoleConst.WORKSPACE_MANAGE, RoleConst.ADMIN], @@ -260,6 +262,7 @@ const systemRouter = { activeMenu: '/system', parentPath: '/system', parentName: 'system', + sameRoute: 'SystemChat', permission: [ new ComplexPermission( [RoleConst.WORKSPACE_MANAGE, RoleConst.ADMIN], @@ -279,6 +282,7 @@ const systemRouter = { activeMenu: '/system', parentPath: '/system', parentName: 'system', + sameRoute: 'SystemChat', permission: [ new ComplexPermission( [RoleConst.ADMIN], @@ -313,7 +317,15 @@ const systemRouter = { activeMenu: '/system', parentPath: '/system', parentName: 'system', - permission: [EditionConst.IS_PE, EditionConst.IS_EE], + sameRoute: 'setting', + permission: [ + new ComplexPermission( + [RoleConst.ADMIN], + [PermissionConst.APPEARANCE_SETTINGS_READ], + [EditionConst.IS_EE, EditionConst.IS_PE], + 'OR', + ), + ], }, component: () => import('@/views/system-setting/theme/index.vue'), }, @@ -325,7 +337,15 @@ const systemRouter = { activeMenu: '/system', parentPath: '/system', parentName: 'system', - permission: [EditionConst.IS_PE, EditionConst.IS_EE], + sameRoute: 'setting', + permission: [ + new ComplexPermission( + [RoleConst.ADMIN], + [PermissionConst.LOGIN_AUTH_READ], + [EditionConst.IS_EE, EditionConst.IS_PE], + 'OR', + ), + ], }, component: () => import('@/views/system-setting/authentication/index.vue'), }, @@ -337,6 +357,15 @@ const systemRouter = { activeMenu: '/system', parentPath: '/system', parentName: 'system', + sameRoute: 'setting', + permission: [ + new ComplexPermission( + [RoleConst.ADMIN], + [PermissionConst.EMAIL_SETTING_READ], + [EditionConst.IS_EE, EditionConst.IS_PE], + 'OR', + ), + ], }, component: () => import('@/views/system-setting/email/index.vue'), }, @@ -353,7 +382,14 @@ const systemRouter = { parentPath: '/system', parentName: 'system', sameRoute: 'operate', - permission: [EditionConst.IS_PE, EditionConst.IS_EE], + permission: [ + new ComplexPermission( + [RoleConst.ADMIN], + [PermissionConst.OPERATION_LOG_READ], + [EditionConst.IS_EE, EditionConst.IS_PE], + 'OR', + ), + ], }, component: () => import('@/views/system/operate-log/index.vue'), }, diff --git a/ui/src/utils/permission/data.ts b/ui/src/utils/permission/data.ts index 45b1fdfcc..f3f46c864 100644 --- a/ui/src/utils/permission/data.ts +++ b/ui/src/utils/permission/data.ts @@ -186,8 +186,6 @@ const PermissionConst = { SHARED_KNOWLEDGE_PROBLEM_EDIT:new Permission('SYSTEM_KNOWLEDGE_PROBLEM:READ+EDIT'), SHARED_KNOWLEDGE_PROBLEM_DELETE:new Permission('SYSTEM_KNOWLEDGE_PROBLEM:READ+DELETE'), - - TOOL_CREATE:new Permission('TOOL:READ+CREATE'), TOOL_EDIT:new Permission('TOOL:READ+EDIT'), TOOL_READ:new Permission('TOOL:READ'), @@ -204,9 +202,17 @@ const PermissionConst = { RESOURCE_TOOL_IMPORT:new Permission('SYSTEM_RES_TOOL:READ+IMPORT'), RESOURCE_TOOL_EXPORT:new Permission('SYSTEM_RES_TOOL:READ+EXPORT'), + APPEARANCE_SETTINGS_READ:new Permission('APPEARANCE_SETTINGS:READ'), + APPEARANCE_SETTINGS_EDIT:new Permission('APPEARANCE_SETTINGS:READ+EDIT'), + LOGIN_AUTH_READ:new Permission('LOGIN_AUTH:READ'), + LOGIN_AUTH_EDIT:new Permission('LOGIN_AUTH:READ+EDIT'), - + EMAIL_SETTING_READ:new Permission('EMAIL_SETTING:READ'), + EMAIL_SETTING_EDIT:new Permission('EMAIL_SETTING:READ+EDIT'), + + OPERATION_LOG_READ:new Permission('OPERATION_LOG:READ'), + OPERATION_LOG_EXPORT:new Permission('OPERATION_LOG:READ+EXPORT'), ABOUT_READ:new Permission('OTHER:READ'), diff --git a/ui/src/views/system-chat-user/authentication/component/CAS.vue b/ui/src/views/system-chat-user/authentication/component/CAS.vue index 366553d77..feac1c0c6 100644 --- a/ui/src/views/system-chat-user/authentication/component/CAS.vue +++ b/ui/src/views/system-chat-user/authentication/component/CAS.vue @@ -48,7 +48,7 @@ v-hasPermission=" new ComplexPermission( [RoleConst.ADMIN], - [PermissionConst.USER_GROUP_REMOVE_MEMBER], + [PermissionConst.CHAT_USER_AUTH_EDIT], [],'OR',)" > {{ $t('common.save') }} diff --git a/ui/src/views/system-chat-user/authentication/component/LDAP.vue b/ui/src/views/system-chat-user/authentication/component/LDAP.vue index 913a96655..02456229e 100644 --- a/ui/src/views/system-chat-user/authentication/component/LDAP.vue +++ b/ui/src/views/system-chat-user/authentication/component/LDAP.vue @@ -69,7 +69,13 @@ {{ $t('views.system.test') }} - + {{ $t('common.save') }} @@ -83,6 +89,8 @@ import authApi from '@/api/chat-user/auth-setting' import type { FormInstance, FormRules } from 'element-plus' import { t } from '@/locales' import { MsgSuccess } from '@/utils/message' +import { PermissionConst, RoleConst } from '@/utils/permission/data' +import { ComplexPermission } from '@/utils/permission/type' const form = ref({ id: '', diff --git a/ui/src/views/system-chat-user/authentication/component/OAuth2.vue b/ui/src/views/system-chat-user/authentication/component/OAuth2.vue index 2d525b07e..5019d7846 100644 --- a/ui/src/views/system-chat-user/authentication/component/OAuth2.vue +++ b/ui/src/views/system-chat-user/authentication/component/OAuth2.vue @@ -90,7 +90,13 @@
- + {{ $t('common.save') }}
@@ -104,6 +110,8 @@ import authApi from '@/api/chat-user/auth-setting' import type { FormInstance, FormRules } from 'element-plus' import { t } from '@/locales' import { MsgSuccess } from '@/utils/message' +import { PermissionConst, RoleConst } from '@/utils/permission/data' +import { ComplexPermission } from '@/utils/permission/type' const form = ref({ id: '', diff --git a/ui/src/views/system-chat-user/authentication/component/OIDC.vue b/ui/src/views/system-chat-user/authentication/component/OIDC.vue index e459d4d4a..6807f1ab4 100644 --- a/ui/src/views/system-chat-user/authentication/component/OIDC.vue +++ b/ui/src/views/system-chat-user/authentication/component/OIDC.vue @@ -87,7 +87,13 @@
- + {{ $t('common.save') }}
@@ -101,6 +107,8 @@ import authApi from '@/api/chat-user/auth-setting' import type { FormInstance, FormRules } from 'element-plus' import { t } from '@/locales' import { MsgSuccess } from '@/utils/message' +import { PermissionConst, RoleConst } from '@/utils/permission/data' +import { ComplexPermission } from '@/utils/permission/type' const form = ref({ id: '', diff --git a/ui/src/views/system-setting/authentication/component/CAS.vue b/ui/src/views/system-setting/authentication/component/CAS.vue index f870b9138..58ca80411 100644 --- a/ui/src/views/system-setting/authentication/component/CAS.vue +++ b/ui/src/views/system-setting/authentication/component/CAS.vue @@ -44,7 +44,13 @@
- + {{ $t('common.save') }}
@@ -58,6 +64,8 @@ import authApi from '@/api/system-settings/auth-setting' import type { FormInstance, FormRules } from 'element-plus' import { t } from '@/locales' import { MsgSuccess } from '@/utils/message' +import { PermissionConst, RoleConst } from '@/utils/permission/data' +import { ComplexPermission } from '@/utils/permission/type' const form = ref({ id: '', diff --git a/ui/src/views/system-setting/authentication/component/LDAP.vue b/ui/src/views/system-setting/authentication/component/LDAP.vue index c40ff9713..f5e32f36c 100644 --- a/ui/src/views/system-setting/authentication/component/LDAP.vue +++ b/ui/src/views/system-setting/authentication/component/LDAP.vue @@ -69,7 +69,13 @@ {{ $t('views.system.test') }} - + {{ $t('common.save') }} @@ -83,6 +89,8 @@ import authApi from '@/api/system-settings/auth-setting' import type { FormInstance, FormRules } from 'element-plus' import { t } from '@/locales' import { MsgSuccess } from '@/utils/message' +import { PermissionConst, RoleConst } from '@/utils/permission/data' +import { ComplexPermission } from '@/utils/permission/type' const form = ref({ id: '', diff --git a/ui/src/views/system-setting/authentication/component/OAuth2.vue b/ui/src/views/system-setting/authentication/component/OAuth2.vue index e2c5d0b7d..98df067d1 100644 --- a/ui/src/views/system-setting/authentication/component/OAuth2.vue +++ b/ui/src/views/system-setting/authentication/component/OAuth2.vue @@ -90,7 +90,13 @@
- + {{ $t('common.save') }}
@@ -104,6 +110,8 @@ import authApi from '@/api/system-settings/auth-setting' import type { FormInstance, FormRules } from 'element-plus' import { t } from '@/locales' import { MsgSuccess } from '@/utils/message' +import { PermissionConst, RoleConst } from '@/utils/permission/data' +import { ComplexPermission } from '@/utils/permission/type' const form = ref({ id: '', diff --git a/ui/src/views/system-setting/authentication/component/OIDC.vue b/ui/src/views/system-setting/authentication/component/OIDC.vue index 37c42b179..04ba7a75b 100644 --- a/ui/src/views/system-setting/authentication/component/OIDC.vue +++ b/ui/src/views/system-setting/authentication/component/OIDC.vue @@ -87,7 +87,13 @@
- + {{ $t('common.save') }}
@@ -101,6 +107,8 @@ import authApi from '@/api/system-settings/auth-setting' import type { FormInstance, FormRules } from 'element-plus' import { t } from '@/locales' import { MsgSuccess } from '@/utils/message' +import { PermissionConst, RoleConst } from '@/utils/permission/data' +import { ComplexPermission } from '@/utils/permission/type' const form = ref({ id: '', diff --git a/ui/src/views/system-setting/authentication/component/SCAN.vue b/ui/src/views/system-setting/authentication/component/SCAN.vue index aed9c592b..0d3bd0fdc 100644 --- a/ui/src/views/system-setting/authentication/component/SCAN.vue +++ b/ui/src/views/system-setting/authentication/component/SCAN.vue @@ -13,7 +13,12 @@
{{ $t('views.system.authentication.scanTheQRCode.access') }} + v-hasPermission=" + new ComplexPermission( + [RoleConst.ADMIN], + [PermissionConst.LOGIN_AUTH_EDIT], + [],'OR',)" + >{{ $t('views.system.authentication.scanTheQRCode.access') }} {{ @@ -92,6 +97,8 @@ import EditModel from './EditModal.vue' import platformApi from '@/api/system-settings/platform-source' import { MsgError, MsgSuccess } from '@/utils/message' import { t } from '@/locales' +import { PermissionConst, RoleConst } from '@/utils/permission/data' +import { ComplexPermission } from '@/utils/permission/type' interface PlatformConfig { [key: string]: string diff --git a/ui/src/views/system-setting/authentication/index.vue b/ui/src/views/system-setting/authentication/index.vue index 19e8bdd1f..db6988a78 100644 --- a/ui/src/views/system-setting/authentication/index.vue +++ b/ui/src/views/system-setting/authentication/index.vue @@ -22,6 +22,7 @@ import OAuth2 from './component/OAuth2.vue' import { t } from '@/locales' import useStore from '@/stores' + const { user } = useStore() const router = useRouter() diff --git a/ui/src/views/system-setting/email/index.vue b/ui/src/views/system-setting/email/index.vue index fb8a243a4..2d48a7afc 100644 --- a/ui/src/views/system-setting/email/index.vue +++ b/ui/src/views/system-setting/email/index.vue @@ -52,7 +52,13 @@ >{{ $t('views.system.email.enableTLS') }} - + {{ $t('common.save') }} @@ -71,6 +77,8 @@ import type { FormInstance, FormRules } from 'element-plus' import { MsgSuccess } from '@/utils/message' import { t } from '@/locales' +import { PermissionConst, RoleConst } from '@/utils/permission/data' +import { ComplexPermission } from '@/utils/permission/type' const form = ref({ email_host: '', diff --git a/ui/src/views/system-setting/theme/index.vue b/ui/src/views/system-setting/theme/index.vue index 37a830682..0501afbc2 100644 --- a/ui/src/views/system-setting/theme/index.vue +++ b/ui/src/views/system-setting/theme/index.vue @@ -244,7 +244,13 @@
{{ $t('theme.abandonUpdate') }} - + {{ $t('theme.saveAndApply') }}
@@ -262,6 +268,8 @@ import ThemeApi from '@/api/system-settings/theme' import { MsgSuccess, MsgError } from '@/utils/message' import useStore from '@/stores' import { t } from '@/locales' +import { PermissionConst, RoleConst } from '@/utils/permission/data' +import { ComplexPermission } from '@/utils/permission/type' const { theme } = useStore() const router = useRouter()