Tenancy, permissions & audit
Security is built in: tenancy isolation is middleware-enforced, permissions act at row level, audit is append-only and immutable.
Tenant isolation
All business data is row-isolated: tenant filtering derives from login state and is middleware-enforced; tenant context comes from the login session. Single-tenant instances first, multi-tenant design ready; cross-tenant escalation has dedicated tests.
Roles & page permissions
| Role | Capabilities |
|---|---|
| Tenant admin | Users, permissions/pages, schema, models, ops, god-mode (audited) |
| admin | Schema + business data + system config |
| editor | Business read/write; schema managed separately |
| viewer | Read-only |
| agent (service) | Restricted protocol calls; high-risk needs approval |
User lifecycle: registration (tenant switch + approval), create, edit, disable/enable, soft delete. Page permissions and backend enforcement stay consistent.
Row visibility & org ownership
Row rules answer “which rows can be seen”: identity match plus all row conditions. Org ownership is the coarse boundary: empty = whole tenant; owned = only that org subtree, narrowed further by row conditions.
Audit & sessions
- Append-only audit: who, when, on what, did what, with what result;
- God-mode and erasure operations fully trailed and replayable;
- Admin sessions: HttpOnly cookie, SameSite=Lax, 7 days; credentials salted-hashed;
- Keys are encrypted at rest and usage is audited.