Skip to content

fix: knowledge document token permission error - #7947

Merged
peslyn merged 1 commit into
v3from
pr@v3@fix_knowledge_document_token_permission_error
Nov 16, 2026
Merged

peslyn merged 1 commit into
v3from
pr@v3@fix_knowledge_document_token_permission_error

Conversation

@shaohuzhang1

Copy link
Copy Markdown
Contributor

fix: knowledge document token permission error

resource_permission_group_list=[ResourcePermissionConst.KNOWLEDGE_MANAGE],
scope=[PermissionScopeConstants.WORKSPACE, PermissionScopeConstants.WORKSPACE_RESOURCE],
),
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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).

  2. Semantic mismatch. The enum being modified has role_list=[WORKSPACE_MANAGE, USER]. If a USER role now carries a MANAGE-level resource permission group, confirm that's the desired authorization model — otherwise it may leak elevated privileges to regular users.

  3. Scope alignment. The entry lists both WORKSPACE and WORKSPACE_RESOURCE scopes. Ensure the KNOWLEDGE_MANAGE group is valid for both scopes; some management permissions may only make sense at resource scope, not workspace scope.

  4. Missing view permission. Replacing rather than adding means callers relying on KNOWLEDGE_VIEW from this entry will lose it. Check whether VIEW is still granted through another meta group; otherwise read-only users could be locked out.

  5. Test coverage. Update/add tests asserting the expected permission set for this meta, since no test diff is included.

  6. Naming consistency (minor optimization). The reference uses ResourcePermissionConst while the visible class prefix in context is PermissionConstants; 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.

@peslyn
peslyn merged commit aada1e7 into v3 Nov 16, 2026
3 of 4 checks passed
@peslyn
peslyn deleted the pr@v3@fix_knowledge_document_token_permission_error branch November 16, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants