Organizations & Multi-Tenancy
Optare is designed around the concept of Organizations. This is the fundamental unit of multi-tenancy in our platform.
The Data Model
- User: An individual identity (e.g.,
john@example.com). - Organization: A group of users (e.g.,
Acme Corp). - Member: The link between a User and an Organization, carrying a Role.
A single User can belong to multiple Organizations with different roles in each.
Roles & Permissions
We provide a flexible RBAC (Role-Based Access Control) system:
| Role | Description |
|---|---|
| Owner | Full access to the organization, including billing and deletion. |
| Admin | Can manage members and integrations. |
| Member | Standard access to application features. |
| Viewer | Read-only access. |
Switching Organizations
When a user logs in, they have an Active Organization. All API requests are scoped to this active organization.
// Switch the active organization for the current session
await auth.organization.switch('org_123');