Organizations & Memberships
These entities define the tenants of a shared application, and who belongs to each.
Entities
- Organization: A tenant: a company or group whose data and members are isolated from others.
- Membership: A user's belonging to an organization.
- Team: A named group of members within an organization.
- Invitation: A pending offer for someone to join an organization.
- Verified Domain: An email domain an organization has proved it controls.
Model
Rendering diagram…
Diagram source
erDiagram
ORGANIZATION ||--o{ MEMBERSHIP : has
USER ||--o{ MEMBERSHIP : holds
ORGANIZATION ||--o{ TEAM : contains
TEAM }o--o{ MEMBERSHIP : includes
ORGANIZATION ||--o{ INVITATION : sends
ORGANIZATION ||--o{ VERIFIED_DOMAIN : owns
Key Rules
- Membership connects users to tenants. A user can belong to several organizations, with different access in each.
- Every tenant-owned record names its tenant. Queries are scoped by organization, so one tenant cannot read another's data.
- Invitations expire. They are single-use and bound to the invited address.