Skip to content

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 ​

  1. Case handlers, not roles, see cases. The duty case_handler lives in relations.grants and reaches Cedar as ModuleRole::"relations.case_handler" through relations.roles_of (ADR 0008's pattern). No relations policy permits Role::"admin" anything, and no policy permits Role::"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 is NOT_FOUND, audited denied.
  2. Parties never handle their own case. A handler who raised a grievance or is a subject of a case gets the party view only (forbid on 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 charged on, 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.
  3. Single-owner self-grant (amends ADR 0008 section 3). In a tenant with exactly one owner, that owner may grant case_handler to themselves while the tenant setting single_owner_self_grant is on (default on). The grant carries self_granted, and its audit entry the flag self_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.
  4. 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_outcomes is 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 reach inbox.approval.unassigned and every admin. An approval or rejection names the case version the 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.
  5. 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 is relations.approval.outcome. Those ids still reveal that a case exists and who handles it, so before the inbox consumes relations.* approvals it must keep them out of inbox.approval.unassigned, out of its MCP tools and out of the payloads kernel.dead_letter.list shows.
    • Only the doors people use: Cedar forbids every relations.* action unless the door is web, graphql or cli (the system's relations.purge.run excepted), 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 through relations.case_audit, a security-definer function bound to the transaction's tenant: the one read of audit.entries outside authz, an exception to ADR 0007's published-interfaces rule recorded here. A later audit viewer must hide every relations.* entry from anyone who is not a case handler, and show a handler only the entries of the cases they may handle.
  6. 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 daily relations.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.

ActionRaiserSubject (visible)ParticipantManager, HR adminCase handlerOwner
grievance raise, withdrawownnonoown onlyown onlyown only
disciplinary opennonononoyesno (unless handler)
case readown grievancefrom charged / sharedthe cases they are onneveryes, not own casesapproval view while named
entry read (sealed)shared or ownshared or ownownneveryes, not own casesapproval view while named
entry addresponse, appealresponse, appealstatementnoanyno
participants, transition, hold, case auditnonononoyes, not own casesno
outcome proposenonononoyes, not own casesno
outcome approve, reject ★nononononamed, not proposernamed fallback
grant set, revoke ★; settingsnononononoyes; self only per 3
purge.runsystem 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 owner carries it). Duplicates sealed text; the handler names the caller as owner of 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.

Orbit by SkySync Tech. Licensed under AGPL-3.0.