Skip to content

Multi-org (enterprise) will re-hit #2734: tenant_isolation RLS strict equality still hides NULL-org platform rows once org-scoping is active #2754

Description

@os-zhuang

Context

#2745 fixed the open-edition half of #2734 at the DRIVER layer: applyTenantScope now treats organization_id IS NULL as a global/platform row. But in true multi-org mode (OS_MULTI_ORG_ENABLED=true + the enterprise @objectstack/organizations registering the org-scoping service), SecurityPlugin STOPS stripping the wildcard tenant_isolation RLS (organization_id == current_user.organization_id, from organization_admin/member_default in default-permission-sets.ts) — and that RLS layer still uses strict equality.

Consequence (predicted, not yet reproduced — needs an enterprise-mode repro)

An enterprise deployment's org admins will see ZERO rows in the org-less platform RBAC tables (sys_position, sys_permission_set, sys_business_unit) over REST — Setup → Access Control empty — the same symptom #2734 had in the open edition, resurfacing one layer up.

Fix directions (pick one, enterprise track)

  1. Enterprise per-org seed replay stamps the platform RBAC rows per organization (matches ADR-0081's per-org bootstrap), or
  2. tenant_isolation gains per-table global-row carve-outs for platform tables (organization_id == current_user.organization_id OR organization_id == null — mirrors the driver-layer semantics of fix(security)!: ADR-0090 follow-ups — driver tenant wall, batch-insert marshaling, scoped counts, vocabulary leftovers #2745), or
  3. platform tables opt out of tenancy (tenancy.enabled: false) and rely on RBAC/managed_by gates alone.

Option 2 keeps one coherent "NULL = global" semantic across both layers.

Related: #2734, #2745, ADR-0081, ADR-0057 (BU tree), ADR-0090.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions