S1: Any admin can silently delete any review comment on an article. Decision D617. No migration. Found by #1165's audit (area 7, comment deletion).
What is true on main
- The route.
DELETE /api/admin/articles/comments/:cid (cloudflare-worker/src/routes/admin_articles.ts) checks only requireAdmin, hard-deletes the row, and always answers {ok: true}, even for an id that does not exist.
- Who loses it. Authors see these comments (
routes/articles.ts), so a delete removes the feedback from their view too. Nothing logs it.
- The alternative. Resolving a comment is the non-destructive path, and it already exists.
The work
- Who may delete: the comment's author (
author_id), or a Super Admin. Anyone else gets 403 not_your_comment.
- An unknown id gets a 404
comment_not_found, never {ok: true}.
- Each delete is logged through
logAdminAction as article_comment_deleted, with the article and comment ids. The comment's text is not logged.
- D617 records the rule.
Files this task owns
cloudflare-worker/src/routes/admin_articles.ts (the comment delete only)
- new Worker tests
documentation/architecture/decisions/D617.md
Do not add a Delete control to the review page. Its design is requested on #1165 (area 7, item 4).
Done when
- Tests cover:
- the author deletes;
- a Super Admin deletes;
- another admin is refused with 403;
- an unknown id gets a 404;
- one audit row per delete, without the text.
- Every new assertion is mutation-checked.
Generated by Claude Code
S1: Any admin can silently delete any review comment on an article. Decision D617. No migration. Found by #1165's audit (area 7, comment deletion).
What is true on
mainDELETE /api/admin/articles/comments/:cid(cloudflare-worker/src/routes/admin_articles.ts) checks onlyrequireAdmin, hard-deletes the row, and always answers{ok: true}, even for an id that does not exist.routes/articles.ts), so a delete removes the feedback from their view too. Nothing logs it.The work
author_id), or a Super Admin. Anyone else gets 403not_your_comment.comment_not_found, never{ok: true}.logAdminActionasarticle_comment_deleted, with the article and comment ids. The comment's text is not logged.Files this task owns
cloudflare-worker/src/routes/admin_articles.ts(the comment delete only)documentation/architecture/decisions/D617.mdDo not add a Delete control to the review page. Its design is requested on #1165 (area 7, item 4).
Done when
Generated by Claude Code