Discord settings: no way to unlink a server, and org owners have no Discord view (all routes platform-admin only) #221

Open
opened 2026-10-04 20:07:43 -04:00 by logan · 3 comments
Owner

Found while building the Discord admin page (PR #219, server-26#213 item 2).

  1. No unlink. PUT /discord/guilds/{id}/link can set or move a server's org, but nothing deletes a discord_guilds doc. A server removed from an org stays linked to it (or must be re-linked to some other org).
  2. Org owners see nothing. /settings/discord is platform-admin only because every route behind it is require_admin_token (GET /discord/admin/overview, /tokens, link). The design (design-canvas/discord-system-notes.md, "Settings > Integrations > Discord") is an org-owner page: their own servers, their own radio channels, invite links for bots that can serve them. Needs org-scoped read routes (overview filtered by acting_org_id, bots filtered to pool + their BYO, no token internals) and owner-level stop/start. Same shape as the DEFERRED.md entry for /settings/members (owner reaches the page, every request 403s) - this one avoids that by hiding the tab, so today an owner simply has no Discord surface.

Pairs with #213 item 1 (self-serve /drb link), which is the natural place to add the owner view.

Found while building the Discord admin page (PR #219, server-26#213 item 2). 1. **No unlink.** `PUT /discord/guilds/{id}/link` can set or move a server's org, but nothing deletes a `discord_guilds` doc. A server removed from an org stays linked to it (or must be re-linked to some other org). 2. **Org owners see nothing.** `/settings/discord` is platform-admin only because every route behind it is `require_admin_token` (`GET /discord/admin/overview`, `/tokens`, link). The design (design-canvas/discord-system-notes.md, "Settings > Integrations > Discord") is an org-owner page: their own servers, their own radio channels, invite links for bots that can serve them. Needs org-scoped read routes (overview filtered by `acting_org_id`, bots filtered to pool + their BYO, no token internals) and owner-level stop/start. Same shape as the DEFERRED.md entry for `/settings/members` (owner reaches the page, every request 403s) - this one avoids that by hiding the tab, so today an owner simply has no Discord surface. Pairs with #213 item 1 (self-serve `/drb link`), which is the natural place to add the owner view.
Author
Owner

PR #218 (feat/213-guild-link, #213 item 1) covers item 1 here for org owners: DELETE /discord/linked-guilds/{id} unlinks the caller's own server (sets org_id null + unlinked_at, stops its streams, never falls back to DISCORD_UNLINKED_GUILD_ORG_ID), and GET /discord/linked-guilds gives owners a list of their linked servers on Settings -> Organization. Item 2's org-scoped channels/bots view is NOT in #218 - still open here. Close item 1 when #218 merges.

PR #218 (feat/213-guild-link, #213 item 1) covers item 1 here for org owners: `DELETE /discord/linked-guilds/{id}` unlinks the caller's own server (sets `org_id` null + `unlinked_at`, stops its streams, never falls back to `DISCORD_UNLINKED_GUILD_ORG_ID`), and `GET /discord/linked-guilds` gives owners a list of their linked servers on Settings -> Organization. Item 2's org-scoped channels/bots view is NOT in #218 - still open here. Close item 1 when #218 merges.
Author
Owner

PR #224 adds the missing removal half: #224

DELETE /discord/guilds/{id} (admin) deletes a server's radio channels and unlinks it with #218 semantics plus removed_at, so it never falls back to DISCORD_UNLINKED_GUILD_ORG_ID. DELETE /discord/streams/{id} (admin) and DELETE /discord/nodes/{node}/streams/{id} (org owner or admin) remove single radio channels.

Item 2 here (an org-owner Discord view: channels and bots filtered to their org) is still not built. Org owners get Remove only on the node page.

PR #224 adds the missing removal half: https://git.vpn.cusano.net/logan/server-26/pulls/224 `DELETE /discord/guilds/{id}` (admin) deletes a server's radio channels and unlinks it with #218 semantics plus `removed_at`, so it never falls back to `DISCORD_UNLINKED_GUILD_ORG_ID`. `DELETE /discord/streams/{id}` (admin) and `DELETE /discord/nodes/{node}/streams/{id}` (org owner or admin) remove single radio channels. Item 2 here (an org-owner Discord view: channels and bots filtered to their org) is still not built. Org owners get Remove only on the node page.
logan added the area/autharea/discord
priority
p2
type
feature
labels 2026-10-05 02:05:04 -04:00
Author
Owner

New detail from #225 S3 (PR #249): PUT /tokens/{id}/prefer/{system_id} now lets an org owner mark their own BYO bot as preferred for their own org's system (owner decision Q2). But an owner still has no way to learn their BYO bots' token_ids, because GET /tokens is admin-only and the new voice-check returns bot names only. The org-scoped bot list in item 2 here (pool + own BYO, no token internals) should include token_id and preferred_for_system_id for the org's own BYO bots, so the owner UI can call /prefer.

New detail from #225 S3 (PR #249): `PUT /tokens/{id}/prefer/{system_id}` now lets an org **owner** mark their own BYO bot as preferred for their own org's system (owner decision Q2). But an owner still has no way to learn their BYO bots' `token_id`s, because `GET /tokens` is admin-only and the new voice-check returns bot names only. The org-scoped bot list in item 2 here (pool + own BYO, no token internals) should include `token_id` and `preferred_for_system_id` for the org's own BYO bots, so the owner UI can call `/prefer`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: logan/server-26#221