fix(sql_workbench): 对齐 ODC 与 CloudBeaver 数据源权限(业务写权关闭场景)#647
Merged
Conversation
…mission ODC workbench datasource sync called CanOpGlobal with isBusinessWrite=false, so a system admin whose business-write permission was disabled still bypassed per-project/per-datasource filtering and could see and execute SQL on all datasources. This diverged from CloudBeaver, whose connectManagement passes isBusinessWrite=true. Pass isBusinessWrite=true here as well so such an admin falls back to project/datasource-level permission filtering, keeping ODC and CloudBeaver datasource visibility consistent.
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Seechi-Yolo
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
超管关闭某用户的业务写权、并为其配置某数据源的项目角色(开发工程师)后:
预期 ODC 与 CloudBeaver 的数据源处理保持一致。
原因
ODC 同步数据源时
getUserAccessibleDBServices调用CanOpGlobal(uid, false),未像 CloudBeaver 的connectManagement那样传入isBusinessWrite=true。系统管理员在业务写权关闭时,CanOpGlobal仍返回true,跳过项目/数据源级过滤,导致 ODC 同步并可见全部活跃数据源;数据源一旦进入 ODC,审核中间件放行后即可执行 SQL。修复
将 ODC 路径
CanOpGlobal的isBusinessWrite参数改为true,与 CloudBeaver 对齐。业务写权关闭的系统管理员改走项目/数据源级权限过滤,cleanupObsoleteDatasources会清理此前多同步进 ODC 的数据源,使 ODC 与 CloudBeaver 数据源可见性一致。关联 Issue
关联 actiontech/dms-ee#810 (系统管理员业务写权开关:关闭后应移出业务候选集、接口层拦截绕过 UI 的写操作)。本次修复补齐 ODC 工作台对该开关的落实。
测试计划