diff --git a/ui/src/permission/modules/model/system.ts b/ui/src/permission/modules/model/system.ts index 099bedebd49..9484c814913 100644 --- a/ui/src/permission/modules/model/system.ts +++ b/ui/src/permission/modules/model/system.ts @@ -23,10 +23,25 @@ const system = { isShare: () => canSys(P.MODEL_READ), // —— 模型资源 —— + /** + * 系统「模型资源管理」(系统 > 资源管理 > 模型)编辑权限 + * */ modify: () => canSys(P.RESOURCE_MODEL_EDIT), + /** + * 系统「模型资源管理」(系统 > 资源管理 > 模型)模型参数设置权限 + * */ paramSetting: () => canSys(P.RESOURCE_MODEL_EDIT), + /** + * 系统「模型资源管理」(系统 > 资源管理 > 模型)删除权限 + * */ delete: () => canSys(P.RESOURCE_MODEL_DELETE), + /** + * 系统「模型资源管理」(系统 > 资源管理 > 模型)资源授权权限 + * */ auth: () => canSys(P.RESOURCE_MODEL_AUTH), + /** + * 系统「模型资源管理」(系统 > 资源管理 > 模型)查看关联资源权限 + * */ relateMap: () => canSys(P.RESOURCE_MODEL_RELATE_RESOURCE_VIEW), } diff --git a/ui/src/permission/modules/model/workspace.ts b/ui/src/permission/modules/model/workspace.ts index 474744abfce..010fd3e24bd 100644 --- a/ui/src/permission/modules/model/workspace.ts +++ b/ui/src/permission/modules/model/workspace.ts @@ -6,6 +6,9 @@ import { PermissionConstants as P } from '../../core' const workspace = { // —— 工作空间级 —— isShare: () => can(P.MODEL_READ), + /** + * 工作空间「模型」创建权限 + */ create: () => can(P.MODEL_CREATE), debug: () => false, authToWorkspace: () => false, @@ -19,10 +22,25 @@ const workspace = { folderDelete: () => can(P.MODEL_DELETE), // —— 模型资源级 —— + /** + * 工作空间「模型」编辑权限 + */ modify: (id: string) => canRes(P.MODEL_EDIT, id), + /** + * 工作空间「模型」模型参数设置权限 + */ paramSetting: (id: string) => canRes(P.MODEL_EDIT, id), + /** + * 工作空间「模型」删除权限 + */ delete: (id: string) => canRes(P.MODEL_DELETE, id), + /** + * 工作空间「模型」资源授权权限 + */ auth: (id: string) => canRes(P.MODEL_RESOURCE_AUTHORIZATION, id), + /** + * 工作空间「模型」查看关联资源权限 + */ relateMap: (id: string) => canRes(P.MODEL_RELATE_RESOURCE_VIEW, id), } diff --git a/ui/src/views/model/index.vue b/ui/src/views/model/index.vue index f599b67f41b..b5fcad69f26 100644 --- a/ui/src/views/model/index.vue +++ b/ui/src/views/model/index.vue @@ -18,6 +18,7 @@ import { ParamSettingAction, RelatedResourcesModelAction, } from './model-card/action-dropdown' +import perm from '@/permission/index.ts' const DEFAULT_MODEL_PROVIDER: ModelProviderItem = { icon: '', name: '全部模型', provider: 'all' } @@ -99,7 +100,7 @@ onMounted(() => {