0.11.6: 渠道权限管控(部门范围 + 用户级授权)

- 迁移 000047:channels.department_ids(空=全局) + channel_grants 用户级授权
  (source=manual/approval 区分来源)。
- 管理端:渠道部门范围配置 + 授权管理(列表/授予/撤销);渠道列表显示范围。
- 门户:我的渠道端点(/api/v1/portal/channels)按部门可见或明确授权返回,
  「个人渠道」页新增可使用渠道区(授权方式标识)。
- 审批流:资源申请中的渠道类型通过后自动写 channel_grants(source=approval),
  取代'批准记录即授权'的弱语义。
- 端到端验证:部门隔离(demo 无部门看不到)→手动授予→可见→撤销→不可见;
  审批通过自动授权。修复 JOIN 列歧义与 uuid/text 比较。
This commit is contained in:
LLMGuardX Dev
2026-08-13 15:03:39 +08:00
parent 277f80dc82
commit 8000bccde3
10 changed files with 392 additions and 26 deletions
+2
View File
@@ -362,6 +362,7 @@ func main() {
portalService.SetApplicationRuntime(portal.NewRuntimeCredentials(db, apiKeyRepository, applicationKeyCipher), workbenchRuntime)
portalService.SetGateway(governedGateway)
portalService.SetMarketplace(marketplaceService)
portalService.SetChannelService(channelService)
portalHandler := portal.NewHTTPHandler(portalService, identityService)
portalAdminHandler := portal.NewAdminHTTPHandler(portalService, identityService)
// License 授权:文件校验 + 账号数管控 + 管理端查看/上传。
@@ -489,6 +490,7 @@ func main() {
controlMux.Handle("/api/v1/portal/agent-policy", agentPolicyHandler)
controlMux.Handle("/api/v1/portal/personal-channels", portalHandler)
controlMux.Handle("/api/v1/portal/personal-channels/", portalHandler)
controlMux.Handle("/api/v1/portal/channels", portalHandler)
controlMux.Handle("/api/v1/portal/digital-employees", portalHandler)
controlMux.Handle("/api/v1/portal/digital-employees/", portalHandler)
controlMux.Handle("/api/v1/portal/resource-requests", portalHandler)