fix: honor project-range op permissions in UserCanOpDB - #660
Open
LordofAvernus wants to merge 1 commit into
Open
fix: honor project-range op permissions in UserCanOpDB#660LordofAvernus wants to merge 1 commit into
LordofAvernus wants to merge 1 commit into
Conversation
PR Reviewer Guide 🔍(Review updated until commit 11b83c2)
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
Persistent review updated to latest commit 3fa422b |
Permissions registered with project range, such as masking audit 700038, are granted through the member/member-group project-manage slot and are stored with op_range_type=project. UserCanOpDB only matched db_service ranges, so holders were never recognised on any datasource and could not be resolved as unmasking approvers. Treat project range as a hit on every datasource in the project, apply the same rule in userCanOpDBWithoutAdminPrivilege so BWP-disabled administrators are not under-matched, and union the project-manage slots into ListUsersOpPermissionInProject so batch lookups return the same permission set as the per-user query already does. No other caller changes behaviour: every needOpPermissionTypes passed to UserCanOpDB or GetCanOpDBUsers elsewhere is a db_service-range permission, and ListDBServiceTips restricts functional_module to three db_service-range values.
LordofAvernus
force-pushed
the
dms-fix-953
branch
from
August 18, 2026 05:14
3fa422b to
67aaf96
Compare
|
Persistent review updated to latest commit 67aaf96 |
LordofAvernus
force-pushed
the
dms-fix-953
branch
from
August 18, 2026 07:34
67aaf96 to
11b83c2
Compare
|
Persistent review updated to latest commit 11b83c2 |
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.
关联的 issue
Fixes actiontech/dms-ee#953
描述你的变更
UserCanOpDB与userCanOpDBWithoutAdminPrivilege将op_range_type=project视为命中项目内全部数据源。脱敏审核(700038)以 project 范围注册、经成员/成员组的「项目管理权限」槽授予,此前不被识别,持有者无法被解析为原文审批人。ListUsersOpPermissionInProject补上成员与成员组项目权限槽的 UNION,使批量查询与单用户查询返回同一套权限。影响面
脱敏审核之外无行为变化。其余传入
UserCanOpDB/GetCanOpDBUsers的权限均为 db_service 范围。project 与 db_service 授权入口互斥:角色走ListMemberOpPermissions(排除 project),成员「项目管理权限」走ListProjectOpPermissions(仅 project)。不放开角色挂载 project 范围权限。不改导出工单「待我处理」筛选;Dashboard 待办后续单独做。
测试
go test -tags dummyhead ./internal/dms/biz/...:TestGetCanOpDBUsers与TestUserCanOpDB_ProjectRange通过,含「仅持有 project 范围脱敏审核的用户不得被导出审批选中」。scripts/verify_build_editions.sh:社区版、试用版构建通过。确认项(pr提交后操作)
Tip
请在指定复审人之前,确认并完成以下事项,完成后✅
not_compatibleneed_update_doc