feat(权限优化)1.AI对话中点击快捷标签问题时,明明已经配置了默认默写为什么还会提示配置?必须点击一下保存并关闭才可以这个不对,只要配置了就可以问答不需要再让用户过来点击一次!如图一、二所示
deploy-hxtesting / build-and-deploy (push) Successful in 1m20s

2.知识库中的企业培训(课件)、企业培训(试题)、配置中心、组织架构、共享空间如图三所示可查看权限归属到超级管理员权限中!如何对
This commit is contained in:
runny committed 2026-11-27 14:49:06 +08:00
1 parent 353f60a175
commit 043e0485e2
14 files changed
+368 -74

No files matched your search

+20
View File
@@ -582,6 +582,12 @@ func (h *KnowledgeBaseHandler) GetKnowledgeBase(c *gin.Context) {
c.Error(err)
return
}
// 企业培训系统默认库(课件/题库)仅超级管理员可查看,防止绕过列表过滤
// 直连详情接口。普通用户的课件/题库读写走培训业务接口(服务端同步)。
if kb.IsTrainingDefaultKB() && !types.IsSystemAdminFromContext(c.Request.Context()) {
c.Error(apperrors.NewForbiddenError("企业培训系统知识库仅超级管理员可查看"))
return
}
// Fill counts (knowledge_count, chunk_count, is_processing) so hover/detail shows correct numbers
if fillErr := h.service.FillKnowledgeBaseCounts(c.Request.Context(), kb); fillErr != nil {
logger.Warnf(c.Request.Context(), "Failed to fill KB counts for %s: %v", kb.ID, fillErr)
@@ -660,6 +666,20 @@ func (h *KnowledgeBaseHandler) ListKnowledgeBases(c *gin.Context) {
return
}
// 企业培训系统默认库(课件/题库)仅超级管理员可见:普通用户走业务模块
// (课程上传/题库导入)由服务端同步,无需在知识库列表直接浏览这两个库。
// 列表计数(@提及/智能体编辑器的知识库选择同源)随本过滤一并收口。
if !types.IsSystemAdminFromContext(ctx) {
filtered := make([]*types.KnowledgeBase, 0, len(kbs))
for _, kb := range kbs {
if kb.IsTrainingDefaultKB() {
continue
}
filtered = append(filtered, kb)
}
kbs = filtered
}
// Optional creator filter — drives the [All | Mine | Others] segmented
// control on the list page. We filter in-process rather than pushing
// down into SQL because the tenant-bounded KB list is small (typically