Skip to main content

Tenant Model

Every resource in AmDital belongs to a workspace. The workspace is resolved from your authenticated session or API key — never from a URL parameter or request body — so a request can only ever act on the workspace its credential actually belongs to.

Data Isolation

AmDital enforces tenant isolation in the application:
  • Every query carries a workspace_id predicate at the application data-access layer, even for trusted-origin reads
  • Application-layer workspace membership verification
Postgres row-level security policies keyed on workspace_id exist on many tables, but production database connections do not yet enforce them, so isolation today rests on the two application-layer checks above.

Membership & Roles

Workspace members have roles (owner, admin, manager, employee, client, consultant) stored in workspace_members. The JWT carries the workspace role claim for server-side enforcement.