Repository navigation
fix: knowledge document token permission error - #7947
Conversation
| resource_permission_group_list=[ResourcePermissionConst.KNOWLEDGE_MANAGE], | ||
| scope=[PermissionScopeConstants.WORKSPACE, PermissionScopeConstants.WORKSPACE_RESOURCE], | ||
| ), | ||
| ) |
There was a problem hiding this comment.
The diff shows a single-line change: KNOWLEDGE_VIEW is replaced with KNOWLEDGE_MANAGE in the resource_permission_group_list of a PermissionMeta entry.
Observations / potential issues:
-
Permissions escalation. Swapping VIEW → MANAGE grants broader capabilities (manage/edit/delete) rather than read-only access. Verify this is intentional and that the permission name/key mapping remains consistent elsewhere (e.g., any hardcoded references to this meta, ACL seed data, or tests).
-
Semantic mismatch. The enum being modified has
role_list=[WORKSPACE_MANAGE, USER]. If aUSERrole now carries a MANAGE-level resource permission group, confirm that's the desired authorization model — otherwise it may leak elevated privileges to regular users. -
Scope alignment. The entry lists both
WORKSPACEandWORKSPACE_RESOURCEscopes. Ensure theKNOWLEDGE_MANAGEgroup is valid for both scopes; some management permissions may only make sense at resource scope, not workspace scope. -
Missing view permission. Replacing rather than adding means callers relying on
KNOWLEDGE_VIEWfrom this entry will lose it. Check whether VIEW is still granted through another meta group; otherwise read-only users could be locked out. -
Test coverage. Update/add tests asserting the expected permission set for this meta, since no test diff is included.
-
Naming consistency (minor optimization). The reference uses
ResourcePermissionConstwhile the visible class prefix in context isPermissionConstants; ensure imports/aliases are correct so the constant resolves as intended.
Recommendation: Confirm intent with the ticket/PR description, verify downstream consumers and ACL seeds, and add a regression test for the resulting permission set.
fix: knowledge document token permission error