Skip to content

fix: Share knowledge base to retrieve hit test menu - #6496

Merged
shaohuzhang1 merged 1 commit into
v2from
pr@v2@fix_knowledge
Jul 23, 2026
Merged

fix: Share knowledge base to retrieve hit test menu#6496
shaohuzhang1 merged 1 commit into
v2from
pr@v2@fix_knowledge

Conversation

@shaohuzhang1

Copy link
Copy Markdown
Contributor

fix: Share knowledge base to retrieve hit test menu

Copilot AI review requested due to automatic review settings July 23, 2026 07:24
@shaohuzhang1
shaohuzhang1 merged commit a99c951 into v2 Jul 23, 2026
4 of 6 checks passed
@shaohuzhang1
shaohuzhang1 deleted the pr@v2@fix_knowledge branch July 23, 2026 07:25
@shaohuzhang1

Copy link
Copy Markdown
Contributor Author

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@shaohuzhang1
shaohuzhang1 restored the pr@v2@fix_knowledge branch July 23, 2026 07:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the UI router’s permission resolution for the Knowledge “hit-test” child route, aiming to support the folderId == 'share' (shared knowledge base) case so the hit-test menu/route can be accessed appropriately.

Changes:

  • Adds folderId == 'share' branches into several permission resolver functions for the KnowledgeHitTest route.
  • Removes the previously existing share-specific permission resolver entries for KnowledgeHitTest.
Comments suppressed due to low confidence (3)

ui/src/router/modules/document.ts:432

  • The else if (to.params.folderId == 'share') {} branch is empty, so this permission function returns undefined for the share route and cannot grant access. Remove the empty branch (so share uses the default permission path) or return an explicit permission for share.
            } else if (to.params.folderId == 'resource-management') {
            } else if (to.params.folderId == 'share') {
            } else {

ui/src/router/modules/document.ts:442

  • This empty share branch causes the permission resolver to return undefined for folderId == 'share', which is treated as a permission failure. If share should behave like the normal knowledge detail route, drop this branch so it falls back to the default permission calculation.
            } else if (to.params.folderId == 'resource-management') {
            } else if (to.params.folderId == 'share') {
            } else {

ui/src/router/modules/document.ts:456

  • The share route currently has no permission entry that can evaluate to true in this KnowledgeHitTest permission array: the new empty share branches return undefined (permission failure) and the previous share-specific permission handlers were removed. This likely prevents the hit-test menu/route from being accessible under folderId == 'share' (unlike other KnowledgeDetail children in this file which include explicit share permissions). Restore the share permission handlers and avoid short-circuiting the default branch with an empty share clause.
            } else if (to.params.folderId == 'resource-management') {
            } else if (to.params.folderId == 'share') {
            } else {
              return PermissionConst.KNOWLEDGE_HIT_TEST_READ.getWorkspacePermissionWorkspaceManageRole()
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 411 to 413
} else if (to.params.folderId == 'resource-management') {
} else if (to.params.folderId == 'share') {
} else {
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.

3 participants