Records Architecture decision

ADR-037

DM Access via Membership, Not a Read Permission

Partially superseded Decided 2026-05-31 Source file

Partially superseded 2026-09-04: ADR-095 keeps DM membership as the participant privacy boundary. It replaces the membership-only message-read rule, the DM thread prohibition, and the static message-permission deny list.

Context

Direct messages used to carry two server-scope permissions:

  • dm.view — access and read DMs.
  • dm.write — start DMs and send messages.

That split made sense when DMs still had traces of the old hidden-space model: the system needed an answer to "can this user access DMs?" Now DMs are rooms with kind: dm, membership is an event-sourced room fact, and room membership is already the privacy boundary for live delivery and reads.

dm.view no longer describes a useful operator action. If a user is a participant in a private conversation, hiding that conversation from them is surprising and not a meaningful abuse-control tool. dm.write also became awkward once it was the only remaining dm.* permission: Chatto already has message.post for "may send messages", and keeping a separate DM send gate makes DMs look more special than they are.

Decision

Remove both DM-specific permission strings as product and authorization concepts.

  • Reading a DM is allowed by room membership alone.
  • Listing DMs returns the DM rooms the caller participates in.
  • Live DM events are filtered by room membership, the same as channel-room events.
  • Humans and bots can start a DM when message.post allows it. Bots need an explicit grant within their owner's authority. Participants can fetch an existing DM without posting permission. All participants need message.post to send root messages in an existing DM.
  • DMs do not support threads. This is a room-kind invariant enforced by the message operation model and low-level Core write path, not an RBAC decision. Flat reply attribution remains available in DMs.
  • The DM privacy boundary remains: permissions such as message.manage, room.manage, message.echo, and channel-style room.create are denied inside DM rooms regardless of role grants.

This decision does not make DMs globally visible. It removes the redundant read gate; the participant set remains the access boundary.

Consequences

  • Operators can still stop DM abuse by revoking message.post, suspending the user, or removing the account.
  • A human must start every DM that includes a bot. After that, membership authorizes bot reads and the bot's normal permissions authorize interactions.
  • Users do not lose read access to conversations they are already part of because an operator toggled a broad server permission.
  • The authorization model becomes easier to explain: membership answers "can read this room?", while message.* permissions answer "can perform this messaging capability?"
  • Effective owners still resolve every permission through the owner override, but cannot bypass room-kind invariants such as the prohibition on DM threads.
  • Historical DM thread events remain readable for compatibility, but current writers cannot create or extend them.
  • Subscription filtering and sidebar queries no longer need a second DM-specific read check on top of membership.
  • API fields, frontend guards, tests, and permission seed data that existed only for dm.view / dm.write have been removed.
  • The channel-room message.read permission does not apply to DMs. A stored message.read decision for a DM does not change participant access.

Records that name this record

Esc