WeKnora/frontend/src
wizardchen cf6c28fe7e fix(rbac-ui): identify org owner row by tenant_id, not user_id
Plan 3 (#1303) lifted Org membership from per-user to per-tenant, and
40fdb978 pinned the org's owner tenant in DB as organizations.owner_tenant_id.
The OrganizationSettingsModal members list, however, still decided
"which row is the owner" by comparing member.user_id against
orgInfo.owner_id. After Plan 3 the members list is keyed on tenant_id,
so the user-id check is structurally wrong: the representative user of
the owner tenant happens to be the owner today, but if that user is
moved to another tenant — or a different user of the owner tenant
becomes the representative — the modal would either lose the "(owner)"
tag, or re-tag a non-owner row, and would offer the role-select /
remove-button affordances on what is in fact the owner tenant row.

This change:

  - Adds OwnerTenantID to OrganizationResponse and populates it in
    toOrgResponse from the persisted column. IsOwner now compares the
    caller's current tenant against owner_tenant_id (with a user-id
    fallback for legacy rows where owner_tenant_id == 0).

  - Adds owner_tenant_id to the frontend Organization type and a small
    isOwnerMember(member) helper in OrganizationSettingsModal, which
    tenant-matches by default and falls back to user-id only on
    pre-000046 rows. The role <select>, role tag suffix, and the
    delete button on member rows now all use the helper.

The "is-me" CSS class and the me-tag in the member name still match
on user_id — that one really is a per-user marker ("this row's user is
me, the signed-in user").
2026-05-18 17:28:58 +08:00
..
api fix(rbac-ui): identify org owner row by tenant_id, not user_id 2026-05-18 17:28:58 +08:00
assets fix(frontend): polish model settings UI and fix disabled brand color 2026-05-07 21:51:22 +08:00
components fix(input-field): improve agent selection logic for shared agents 2026-05-18 17:28:58 +08:00
composables feat(rbac-ui): rework tenant identity surfaces 2026-05-18 17:28:58 +08:00
hooks feat(knowledge-base): document list filters and explicit batch-management UX 2026-05-12 18:29:47 +08:00
i18n feat(rbac-ui): rework tenant identity surfaces 2026-05-18 17:28:58 +08:00
router fix(rbac): role-aware UI gates leaked write affordances after tenant switch 2026-05-18 17:28:58 +08:00
stores feat(rbac): lift org membership from per-user to per-tenant (Plan 3, #1303) 2026-05-18 17:28:58 +08:00
types feat(frontend): chunking debug panel with live preview 2026-05-06 17:17:07 +08:00
utils feat(ui): redirect tenant switch away from tenant-scoped routes 2026-05-18 17:28:58 +08:00
views fix(rbac-ui): identify org owner row by tenant_id, not user_id 2026-05-18 17:28:58 +08:00
wailsjs feat: implement automatic update checking and downloading functionality in the desktop app, enhancing user experience with seamless updates and corresponding UI settings 2026-04-11 18:51:16 +08:00
App.vue fix(rbac): role-aware UI gates leaked write affordances after tenant switch 2026-05-18 17:28:58 +08:00
main.ts perf(wiki): lazy-load sidebar page list with virtual-scroll tabs 2026-05-08 15:07:59 +08:00