Skip to content

Allow admins to be part of multiple organizations #44

@jeroenrinzema

Description

@jeroenrinzema

Goal

The admins table currently has an organization_id column, limiting admins to a single organization. This needs to be refactored so users can belong to multiple organizations.

Scope

Database Migration

  • Create a new organization_users many-to-many table linking admins to organizations with roles (member, admin, owner).
  • Backfill organization_users from existing admins.organization_id data.
  • Drop the organization_id column from the admins table after backfill.

Backend Updates

  • Update all backend queries that rely on admins.organization_id to use the new organization_users table.
  • Update the Clerk auth flow — currently auto-provisions a single org on first login. Needs to handle users that already exist across multiple organizations.

OpenFGA Authorization Model

  • Update the OpenFGA authorization model and relationship tuples to reflect the new organization_users structure.
  • Ensure RBAC checks work correctly for users belonging to multiple organizations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions