Appearance
0018. Relations cases: who sees a case, and what owners may do
Status: proposed, pending the owner's decision D5 (plan section 6) and the security reviewer. The defaults below ship as tenant settings so the owner can overturn them without a code change. Amends ADR 0008 (section 3, "granting to oneself is refused") for the relations module only. Applies to modules/relations and, for the audit viewer of a later wave, to whoever builds it.
Context
relations holds grievances and disciplinary cases: harassment complaints, charges, statements, hearing minutes and outcomes. A visibility bug here harms a person directly. Every other module lets owners do everything through the role hierarchy (owner in admin in member, ADR 0001), and ADR 0008 lets owners hold every power of a duty module while forbidding anyone to grant a duty to themselves. Applied to relations, that would let an owner read a grievance about themselves, and a one-owner company could never name a case handler at all.
Decision
- Case handlers, not roles, see cases. The duty
case_handlerlives inrelations.grantsand reaches Cedar asModuleRole::"relations.case_handler"throughrelations.roles_of(ADR 0008's pattern). No relations policy permitsRole::"admin"anything, and no policy permitsRole::"owner"a case, an entry, a list of cases or a case's audit trail. Owners only manage duties and settings, and approve outcomes in the case of section 4. HR admins and managers without the duty see nothing, not even that a case exists: a case they ask for isNOT_FOUND, auditeddenied. - Parties never handle their own case. A handler who raised a grievance or is a subject of a case gets the party view only (
forbidon every handler action for the party kinds). The handler computes the caller's standing from the loaded row (raiser, subject, participant, named approver, none) and names it in the resource kind; Cedar decides. A handler who becomes a subject later loses the handler view on the next request.- The raiser sees their grievance's status, its summary and the entries shared with them or written by them.
- A subject sees a disciplinary case from
chargedon, and a grievance only once a handler has shared an entry with them; then only the entries shared with them or written by them, never the summary or the outcome. - A participant (investigator, witness, representative) who is not a handler sees the case's existence and status and the entries they wrote.
- Single-owner self-grant (amends ADR 0008 section 3). In a tenant with exactly one owner, that owner may grant
case_handlerto themselves while the tenant settingsingle_owner_self_grantis on (default on). The grant carriesself_granted, and its audit entry the flagself_granted. With two or more owners the usual rule applies: never for oneself. A self-granted owner is an ordinary handler: they still never see a case they are a party to. Duties are still owner-only, sensitive and reachable only through the web, GraphQL and CLI doors. - Four-eyes on outcomes, owners as the fallback. A proposed outcome (sealed) is approved or rejected by someone other than the proposer. Its approvers are frozen on proposal: the other handlers who are not parties; when there are none and the tenant setting
owner_approves_outcomesis on (default on), the owners who are not parties and not the proposer. An owner named this way gets the approval view (summary, proposed outcome, entries) of that case only while the approval is pending. When nobody is left, the proposal is refused (no_approver): an approval is never emitted with an empty approver set, so it can never reachinbox.approval.unassignedand every admin. An approval or rejection names the caseversionthe approver read and is refused (stale) if the case changed since, so a re-proposal is never approved unseen. A frozen name alone is not access: a named handler whose duty is revoked, or a named owner who is no longer an owner, loses the approval view, the case in their own list and the decision on their next request. - Nothing leaves the module that names a person's case.
- Event payloads carry ids only: the case id and, for
relations.approval.requested, the requester and the frozen approvers; never a category, summary or outcome. The inbox item's summary key isrelations.approval.outcome. Those ids still reveal that a case exists and who handles it, so before the inbox consumesrelations.*approvals it must keep them out ofinbox.approval.unassigned, out of its MCP tools and out of the payloadskernel.dead_letter.listshows. - Only the doors people use: Cedar forbids every
relations.*action unless the door isweb,graphqlorcli(the system'srelations.purge.runexcepted), so MCP, a plugin acting as a person or any later door reach nothing. API clients and agents get nothing either (no policy names them). - Lists are read-audited like a case read (
category), since they name categories. - Audit entries name the action and the actor. The module's own case trail (
relations.case.audit, handlers' case view only) joins the audit entries of the requests that changed that case throughrelations.case_audit, a security-definer function bound to the transaction's tenant: the one read ofaudit.entriesoutside authz, an exception to ADR 0007's published-interfaces rule recorded here. A later audit viewer must hide everyrelations.*entry from anyone who is not a case handler, and show a handler only the entries of the cases they may handle.
- Event payloads carry ids only: the case id and, for
- Retention (D6, pending a lawyer). A closed or withdrawn case is purged
retention_years(tenant setting, default 7) after it closed, unless it is under legal hold: the dailyrelations.purge.run(system only) clears the summary, the outcome and every entry's body; rows stay so counts and the audit trail survive.
Allow/deny matrix
Every door but web, graphql and cli is forbidden for every action; API clients, agents and other tenants get nothing in any row.
| Action | Raiser | Subject (visible) | Participant | Manager, HR admin | Case handler | Owner |
|---|---|---|---|---|---|---|
| grievance raise, withdraw | own | no | no | own only | own only | own only |
| disciplinary open | no | no | no | no | yes | no (unless handler) |
| case read | own grievance | from charged / shared | the cases they are on | never | yes, not own cases | approval view while named |
| entry read (sealed) | shared or own | shared or own | own | never | yes, not own cases | approval view while named |
| entry add | response, appeal | response, appeal | statement | no | any | no |
| participants, transition, hold, case audit | no | no | no | no | yes, not own cases | no |
| outcome propose | no | no | no | no | yes, not own cases | no |
| outcome approve, reject ★ | no | no | no | no | named, not proposer | named fallback |
| grant set, revoke ★; settings | no | no | no | no | no | yes; self only per 3 |
| purge.run | system only |
Consequences
- A grievance about the only handler (or the only owner) is visible to nobody but its raiser until an owner names another handler; the raiser is told so (
no_handler). The owner learns nothing about the case. - An owner cannot overrule the module: an owner who must see every case grants themselves the duty (one-owner tenants) or is granted it by a co-owner, and even then never sees a case they are a party to.
- Four-eyes needs a second person. A one-person company cannot decide an outcome; that is intended.
Alternatives considered
- Owners see everything, as in payroll. Simplest, but an owner would read a grievance about themselves. Rejected (plan D5).
- Per-audience entry rows (one row per person an entry is shared with, so
ownercarries it). Duplicates sealed text; the handler names the caller asownerof an entry shared with them instead, from the loaded row, which keeps ADR 0001's rule that ownership comes from the row. - Inbox approvals for outcomes. The module emits the approval pair with the case id only and never an empty approver set; the inbox consuming it is the inbox lane's change. Until then approvers see pending outcomes in the module's own case list.