WeKnora/frontend/src
LuckVd 07e6e2984a
fix(knowledge): hide mutation controls on read-only shared knowledge bases (#3103)
A user browsing an org-shared knowledge base with a viewer (read-only)
grant still saw upload/edit/delete/settings controls when they are an
admin of their own personal workspace: KnowledgeBase.vue's canEdit /
canManage fell back to authStore.hasRole('admin') (the LOCAL tenant
role) unless the org share list happened to contain the KB, and
KnowledgeBaseList.vue's canManageKBCard never consulted the share
permission at all. Every such click is rejected by the backend's
3-D permission cap (effective = min(share, org_role, tenant_role),
RequireKBAccess requires OrgRoleEditor for mutations), so the buttons
were dead ends that made read-only shares look writable (#3098).

Both surfaces now treat an explicit cross-tenant grant as the single
source of truth: the effective permission (org share list entry or
my_permission from GET /knowledge-bases/:id, already capped
server-side) is checked first, and only owner/admin/editor grants
enable editing (owner/admin for manage). The local admin/creator
fallbacks stay reserved for own-tenant knowledge bases, so no
previously working action is hidden. Shared cards that lost their
permission field through the pin/recents merges (isMine === false)
are treated as read-only instead of falling through to the local
admin role.

Fixes #3098

Co-authored-by: LuckVd <LuckVd@users.noreply.github.com>
2026-09-21 13:10:20 +08:00
..
api fix(agent): scope the @Skill and @MCP pickers to the agent that will run (#3475) 2026-09-21 13:02:34 +08:00
assets refactor(models): rebuild vendor integration on protocol + catalog + vendor layers (#3470) 2026-09-20 21:28:23 +08:00
components fix(agent): scope the @Skill and @MCP pickers to the agent that will run (#3475) 2026-09-21 13:02:34 +08:00
composables fix(agent): end the turn when the completion cap truncates an answer (#3449) 2026-09-20 13:17:50 +08:00
config feat(mcp): add built-in MCP server with per-workspace endpoints (#3371) 2026-09-17 22:40:05 +08:00
directives fix(frontend): keep streamed Mermaid diagrams from reverting to code (#2885) 2026-08-31 13:25:50 +08:00
hooks feat(frontend): show overall progress for knowledge file uploads (#3399) 2026-09-18 16:43:59 +08:00
i18n refactor(models): rebuild vendor integration on protocol + catalog + vendor layers (#3470) 2026-09-20 21:28:23 +08:00
router feat(artifacts): artifacts library page backed by a message_artifacts table (#3384) 2026-09-18 12:10:19 +08:00
stores fix(agent): scope the @Skill and @MCP pickers to the agent that will run (#3475) 2026-09-21 13:02:34 +08:00
types refactor(agent): consolidate knowledge retrieval tools into search_knowledge, read_document, list_documents (#3381) 2026-09-18 14:12:22 +08:00
utils fix(knowledge): hide mutation controls on read-only shared knowledge bases (#3103) 2026-09-21 13:10:20 +08:00
views fix(knowledge): hide mutation controls on read-only shared knowledge bases (#3103) 2026-09-21 13:10:20 +08:00
wailsjs fix: align client sessions and integration request handling (#3305) 2026-09-16 16:20:57 +08:00
App.vue feat(i18n): add Japanese (ja-JP) locale support (#3080) 2026-09-07 19:20:41 +08:00
embed-main.ts feat(agent): unify sandbox tools and drop host preloaded skills (#3033) 2026-09-05 16:45:59 +08:00
main.ts refactor(frontend): style consistency pass — shared shells, tokens, unified confirmations (#3376) 2026-09-17 23:11:08 +08:00