Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/src/permission/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const buildBaseResourcePermission = (permission: Permission, resourceId:
export const hasEdition=(edition:Edition)=>{
const { auth } = useStore()
if(edition==Edition.PE||edition==Edition.EE){
return auth.baseProfile?.license_is_valid
return auth.baseProfile?.license_is_valid && edition==auth.baseProfile?.edition
}
return true
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/permission/modules/application/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const system = {
/**
* 系统「应用资源管理」(系统 > 资源管理 > 应用)只读权限
* */
read: () => canSys(P.RESOURCE_APPLICATION_READ) && hasEdition(Edition.PE),
read: () => canSys(P.RESOURCE_APPLICATION_READ) && hasEdition(Edition.EE),
}

export default system
2 changes: 1 addition & 1 deletion ui/src/permission/modules/knowledge/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const share = {
/**
* 系统「共享知识库」(系统 > 共享 > 知识库)只读权限
* */
read: () => canSys(P.SHARED_KNOWLEDGE_WORKFLOW_READ) && hasEdition(Edition.PE),
read: () => canSys(P.SHARED_KNOWLEDGE_WORKFLOW_READ) && hasEdition(Edition.EE),
}

export default share
2 changes: 1 addition & 1 deletion ui/src/permission/modules/knowledge/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const system = {
/**
* 系统「知识库资源管理」(系统 > 资源管理 > 知识库)只读权限
* */
read: () => canSys(P.RESOURCE_KNOWLEDGE_DOCUMENT_READ) && hasEdition(Edition.PE),
read: () => canSys(P.RESOURCE_KNOWLEDGE_DOCUMENT_READ) && hasEdition(Edition.EE),
}

export default system
2 changes: 1 addition & 1 deletion ui/src/permission/modules/model/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const share = {
/**
* 系统「共享模型」(系统 > 共享 > 模型)只读权限
*/
read: () => canSys(P.SHARED_MODEL_READ) && hasEdition(Edition.PE),
read: () => canSys(P.SHARED_MODEL_READ) && hasEdition(Edition.EE),

// —— 模型资源 ——
create: () => canSys(P.SHARED_MODEL_CREATE),
Expand Down
2 changes: 1 addition & 1 deletion ui/src/permission/modules/model/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const system = {
/**
* 系统「模型资源管理」(系统 > 资源管理 > 模型)只读权限
* */
read: () => canSys(P.RESOURCE_MODEL_READ) && hasEdition(Edition.PE),
read: () => canSys(P.RESOURCE_MODEL_READ) && hasEdition(Edition.EE),
isShare: () => canSys(P.MODEL_READ),

// —— 模型资源 ——
Expand Down
2 changes: 1 addition & 1 deletion ui/src/permission/modules/system/appearance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
/**
* 系统「外观设置」只读权限
*/
read: () => canSys(P.APPEARANCE_SETTINGS_READ) && hasEdition(Edition.PE),
read: () => canSys(P.APPEARANCE_SETTINGS_READ) && (hasEdition(Edition.PE)||hasEdition(Edition.EE)),
/**
* 系统「外观设置」编辑权限
*/
Expand Down
2 changes: 1 addition & 1 deletion ui/src/permission/modules/system/chatAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
/**
* 系统「对话用户认证」只读权限
*/
read: () => canSys(P.CHAT_USER_AUTH_READ) && hasEdition(Edition.PE),
read: () => canSys(P.CHAT_USER_AUTH_READ) && (hasEdition(Edition.PE)||hasEdition(Edition.EE)),
/**
* 系统「对话用户认证」编辑权限
*/
Expand Down
2 changes: 1 addition & 1 deletion ui/src/permission/modules/system/homepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export default {
/**
* 系统「首页」只读权限
*/
read: () => hasPermission([RoleConstants.ADMIN,P.HOMEPAGE_READ],Compare.OR) && hasEdition(Edition.PE),
read: () => hasPermission([RoleConstants.ADMIN,P.HOMEPAGE_READ],Compare.OR) && hasEdition(Edition.EE),
export: () => hasPermission([RoleConstants.ADMIN,P.HOMEPAGE_EXPORT],Compare.OR)
}
2 changes: 1 addition & 1 deletion ui/src/permission/modules/system/loginAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
/**
* 系统「用户认证」只读权限
*/
read: () => canSys(P.LOGIN_AUTH_READ) && hasEdition(Edition.PE),
read: () => canSys(P.LOGIN_AUTH_READ) && (hasEdition(Edition.PE)||hasEdition(Edition.EE)),
/**
* 系统「用户认证」编辑权限
*/
Expand Down
2 changes: 1 addition & 1 deletion ui/src/permission/modules/system/operationLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
/**
* 系统「操作日志」只读权限
*/
read: () => canSys(P.OPERATION_LOG_READ) && hasEdition(Edition.PE),
read: () => canSys(P.OPERATION_LOG_READ) && (hasEdition(Edition.PE)||hasEdition(Edition.EE)),
/**
* 系统「操作日志」导出权限
*/
Expand Down
5 changes: 3 additions & 2 deletions ui/src/permission/modules/system/other.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/** 系统「其他/关于」类按钮权限 → $perm.other.* */

import { canSys } from '../../policy'
import { PermissionConstants as P, hasPermission, RoleConstants, Compare} from '../../core'
import { PermissionConstants as P, hasPermission, RoleConstants, Compare, hasEdition} from '../../core'
import { Edition } from '@/permission/core/common'

export default {
/**
Expand All @@ -23,7 +24,7 @@ export default {
/**
* 系统「其他/关于」系统APIKey权限
*/
systemApiKey: () => hasPermission([RoleConstants.ADMIN,RoleConstants.WORKSPACE_MANAGE,P.SYSTEM_API_KEY_EDIT],Compare.OR),
systemApiKey: () => hasPermission([RoleConstants.ADMIN,RoleConstants.WORKSPACE_MANAGE,P.SYSTEM_API_KEY_EDIT],Compare.OR) && (hasEdition(Edition.PE)||hasEdition(Edition.EE)),
/**
* 系统「其他/关于」门户权限
*/
Expand Down
2 changes: 1 addition & 1 deletion ui/src/permission/modules/system/role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
/**
* 系统「角色管理」只读权限
* */
read: () => hasPermission([RoleConstants.ADMIN,RoleConstants.WORKSPACE_MANAGE,P.ROLE_READ],Compare.OR) && hasEdition(Edition.PE),
read: () => hasPermission([RoleConstants.ADMIN,RoleConstants.WORKSPACE_MANAGE,P.ROLE_READ],Compare.OR) && (hasEdition(Edition.PE)||hasEdition(Edition.EE)),
/**
* 系统「角色管理」创建权限
*/
Expand Down
2 changes: 1 addition & 1 deletion ui/src/permission/modules/system/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
/**
* 系统「工作空间」只读权限
* */
read: () => hasPermission([RoleConstants.ADMIN,RoleConstants.WORKSPACE_MANAGE,P.WORKSPACE_READ],Compare.OR) && hasEdition(Edition.PE),
read: () => hasPermission([RoleConstants.ADMIN,RoleConstants.WORKSPACE_MANAGE,P.WORKSPACE_READ],Compare.OR) && hasEdition(Edition.EE),
/**
* 系统「工作空间」创建权限
*/
Expand Down
2 changes: 1 addition & 1 deletion ui/src/permission/modules/tool/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const share = {
/**
* 系统「共享工具」(系统 > 共享 > 工具)只读权限
*/
read: () => canSys(P.SHARED_TOOL_READ) && hasEdition(Edition.PE),
read: () => canSys(P.SHARED_TOOL_READ) && hasEdition(Edition.EE),

// —— 工具资源 ——
create: () => canSys(P.SHARED_TOOL_CREATE),
Expand Down
2 changes: 1 addition & 1 deletion ui/src/permission/modules/tool/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const system = {
/**
* 系统「工具资源管理」(系统 > 资源管理 > 工具)只读权限
* */
read: () => canSys(P.RESOURCE_TOOL_READ) && hasEdition(Edition.PE),
read: () => canSys(P.RESOURCE_TOOL_READ) && hasEdition(Edition.EE),
isShare: () => canSys(P.SHARED_TOOL_READ),

// —— 工具资源 ——
Expand Down
Loading