Doklo

leaf-web

Dok Hub

IA9Roles4Lexicon0Code mapping

Doks

Doks 7·Domains 7

All 7Needs review 2Active 5Stale 3
7 Doks shown

Admin

ADMIN-MODERATIONAdmin review moderation

Sign in

AUTH-SIGNINEmail and password sign-in

Sign up

AUTH-SIGNUPNew account registrationdrift

Reading circles

CIRCLESReading circle membership managementdrift

Reading journal

JOURNALBook reflection journal

Bookshelf

LIBRARYPersonal reading shelf tracker

Notifications

NOTICESClub update notificationsdrift
Read-only demo

Product preview

Dok Hub

You’re browsing a read-only sample workspace — a fictional reading-circle app, read by Doklo and reviewed by a person. Nothing here can be changed. Free to start: 40 credits on your first GitHub connection, and every repository’s first generation free (up to 30 Doks). Get started free · Back to doklo.io

ADMIN-MODERATIONdraftcritical

Admin review moderation

Administrators review all member reading reflections (reviews) in one list and can hide or restore any entry to control the quality of content shown to other users. The action is enforced server-side: only users with the ADMIN role may change a review's hidden state, and the request must reference a real review with a valid hidden flag.

Document details · v1
5 steps · 4 rules · 6 criteriaweb · admin · api#moderation #admin #reviews #content-quality #hide-restore

Waiting for your review. Until you approve it, AI agents do not treat it as fact and it stays out of your Live Docs.

User flow 3Business rules 4Acceptance criteria 6

User flow

3
  1. 01

    admin

    Open the moderation screen to see all submitted reviews

    Result

    The screen lists every review with its book, author, date, visibility and hidden status; if there are none, an empty-state message is shown instead

    Starts when · Signed-in user has the ADMIN role

    Interaction details
    • all · navigate
  2. 02

    admin

    Hide an inappropriate review from general view

    Result

    The review card's button shows the hide action and, once clicked, is disabled while the request is in flight

    Starts when · A review in the list is currently not hidden

    Interaction details
    • all · click
  3. 03

    admin

    Restore a previously hidden review

    Result

    The button label switches to the restore action for hidden reviews; clicking it sends the same moderation request with hidden set to false, unhiding the review on success

    Starts when · A review in the list is currently hidden

    Interaction details
    • all · click

Business rules

4

Policies and constraints the product must keep.

  • 01PermissionBR-ADMIN-MODERATION-01

    Only a user whose role is ADMIN may hide or restore a review; any other role receives a FORBIDDEN error with status 403.

    Rule scope and code anchor

    Roles · ROLE-ADMIN

    Linked criteria 2Criterion 01Criterion 02
    Read linked criteria here
    • AC-ADMIN-MODERATION-01When an authenticated ADMIN sends a moderation request with a valid reviewId and a boolean hidden value, the system updates the review's hidden flag and returns { ok: true, status: 200 }.
    • AC-ADMIN-MODERATION-02When the acting user's role is not ADMIN, the moderation request fails with { ok: false, status: 403, error: 'FORBIDDEN' } and no review is changed.
  • 02ValidationBR-ADMIN-MODERATION-02

    The moderation request body must be a plain object containing a boolean 'hidden' field; otherwise a VALIDATION error with status 400 is returned.

    Linked criteria 2Criterion 01Criterion 03
    Read linked criteria here
    • AC-ADMIN-MODERATION-01When an authenticated ADMIN sends a moderation request with a valid reviewId and a boolean hidden value, the system updates the review's hidden flag and returns { ok: true, status: 200 }.
    • AC-ADMIN-MODERATION-03When the request body is missing the 'hidden' field or it is not a boolean, the system returns { ok: false, status: 400, error: 'VALIDATION' }.
  • 03ValidationBR-ADMIN-MODERATION-03

    The reviewId in the request must match an existing review; if none is found, a NOT_FOUND error with status 404 is returned.

    Linked criteria 2Criterion 01Criterion 04
    Read linked criteria here
    • AC-ADMIN-MODERATION-01When an authenticated ADMIN sends a moderation request with a valid reviewId and a boolean hidden value, the system updates the review's hidden flag and returns { ok: true, status: 200 }.
    • AC-ADMIN-MODERATION-04When the reviewId does not match any existing review, the system returns { ok: false, status: 404, error: 'NOT_FOUND' }.
  • 04RestrictionBR-ADMIN-MODERATION-04

    The request must carry a valid, unexpired session token resolving to a known user; otherwise an UNAUTHENTICATED error with status 401 is returned.

    Linked criteria 1Criterion 05
    Read linked criteria here
    • AC-ADMIN-MODERATION-05When the request has no valid, unexpired session, the system returns { ok: false, status: 401, error: 'UNAUTHENTICATED' } and the review remains unchanged.

Acceptance criteria

6

Expected outcomes. These entries do not claim a test was run or passed.

  1. 01CriterionAC-ADMIN-MODERATION-01

    When an authenticated ADMIN sends a moderation request with a valid reviewId and a boolean hidden value, the system updates the review's hidden flag and returns { ok: true, status: 200 }.

    Linked rules 3Rule 01Rule 02Rule 03
  2. 02CriterionAC-ADMIN-MODERATION-02

    When the acting user's role is not ADMIN, the moderation request fails with { ok: false, status: 403, error: 'FORBIDDEN' } and no review is changed.

    Linked rules 1Rule 01
  3. 03CriterionAC-ADMIN-MODERATION-03

    When the request body is missing the 'hidden' field or it is not a boolean, the system returns { ok: false, status: 400, error: 'VALIDATION' }.

    Linked rules 1Rule 02
  4. 04CriterionAC-ADMIN-MODERATION-04

    When the reviewId does not match any existing review, the system returns { ok: false, status: 404, error: 'NOT_FOUND' }.

    Linked rules 1Rule 03
  5. 05CriterionAC-ADMIN-MODERATION-05

    When the request has no valid, unexpired session, the system returns { ok: false, status: 401, error: 'UNAUTHENTICATED' } and the review remains unchanged.

    Linked rules 1Rule 04
  6. 06CriterionAC-ADMIN-MODERATION-06

    The moderation list view displays every review regardless of hidden status, labeling hidden ones, and shows an empty-state message when no reviews exist.

    Linked rules 0
Source files 21
  • page.tsx
  • LeafProvider.tsx
  • useLeafState.ts
  • useLeafLocale.ts
  • locale.ts
  • layout.tsx
  • headings.tsx
  • store.mjs
  • initial-state.mjs
  • password.mjs
  • action-support.ts
  • domain-error.mjs
  • session.mjs
  • validation.mjs
  • types.ts
  • FeatureFrame.tsx
  • moderation.tsx
  • reviews.tsx
  • actions.ts
  • moderation.mjs
  • actionView.ts

Source anchors are injected deterministically. No GitHub repository is connected. File links are unavailable.

Hub context & agents

Hub trust

Doks
7
Source anchors
133
Model-generated anchors
0
Average confidence
—

Source anchors are injected deterministically. This is not a check of every statement in a Dok.

Agents query this hub

doklo.get_dok("ADMIN-MODERATION")

Admin review moderation
5 steps · 4 rules · 6 criteria
is_stale: false
anchors: 21 files

search_doks · get_dok · list_doks

Cursor and Claude Code can use Doklo’s MCP tools to read Doks and their code references.

Storage

Your Hub lives in Doklo Cloud, reviewed here and used by agents and published docs. Sync back to your own git is on the roadmap.

On this Dok

User flowBusiness rulesAcceptance criteria

Evidence

21 source files recorded for this Dok.

View source files →

Document

Version 1

web · admin · api · critical

About this status

This Dok has not been approved. Approval and source freshness are separate facts.

Tracked source files match the recorded baseline.

Hub context & agents →