Story: Act inside a tenant
Table of Contents
This page documents a story in Sprint 26. It captures the goal, current status, acceptance criteria, and the tasks that compose it.
1. Goal
A system administrator can enter one tenant on purpose, see on every screen that they are acting in it, read its data through the same reads its own members use, and leave. Row-level security does the scoping from the session's token, so no read takes a tenant parameter and no cross-tenant subject is needed. The hand-written refdata.v1.parties.list-of-tenant read is removed.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent sprint | Sprint 26 |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing; the story is closed. |
| Last touched | 2026-10-03 |
3. Acceptance
- The journey Act inside a tenant is written first, with its wireframe.
- Entering a tenant needs iam::tenants:impersonate, refuses the system tenant as a target, and is recorded in the audit trail.
- While acting in a tenant, every screen says so and offers the way out; leaving returns to system administration.
- The tenant's parties are read with refdata.v1.parties.list in the tenant's session, paged, with no fixed cap.
- refdata.v1.parties.list-of-tenant, its service, handler, tests and shell command are removed.
- Every new behaviour is proved by a test, and each screen was read against the running deployment.
4. Tasks
| Task | State | Start | End | Description |
|---|---|---|---|---|
| Scaffold story: Act inside a tenant | DONE | 2026-10-03 | 2026-10-03 | Story scaffolding rides this task: documents, sprint wiring, and the scaffold PR. Close it before merging that PR. |
| Write the act inside a tenant journey | DONE | 2026-10-03 | 2026-10-03 | Initial task for: Act inside a tenant |
| Issue a session inside a tenant | DONE | 2026-10-03 | 2026-10-03 | An iam operation that gives a system administrator a session scoped to one tenant: it checks iam::tenants:impersonate, refuses the system tenant, and records the entry in the audit trail. |
| Enter and leave a tenant in the web | DONE | 2026-10-03 | 2026-10-03 | The tenant screen offers Act in this tenant; while in it, every screen says so and offers the way out; leaving returns to system administration. |
| Read a tenant's parties from inside it | DONE | 2026-10-03 | 2026-10-03 | Read the tenant's parties with the ordinary paged refdata.v1.parties.list in the tenant's session, and remove the cross-tenant read and its 1000 cap. |
5. Decisions
- A tenant's data is read from inside the tenant, in a session scoped to it; no read takes a tenant parameter, and row-level security scopes the ordinary reads from the token.
- Inside a tenant, data is read only. The token carries only the read permissions the administrator holds, and the BFF refuses every change before the route runs. A system administrator changes a tenant only by deleting all of it.
- Entering checks
iam::tenants:impersonateagainst the database, because a person's token carries no permissions. - The tenant session is not refreshed; when it lapses, the browser returns to the system session without a sign-in.
- The client owns the entered tenant and its outside token; the BFF session reads from it, so there is one source of truth.
- Entering and leaving are recorded in the entered tenant's own audit trail.
6. Out of scope
7. Result
All tasks done.