Add admin-only unpublished article previews to site template #216

Closed
opened 2026-06-27 16:07:45 -05:00 by erik · 2 comments
Owner

Problem

slugkit.com now supports authenticated admin users previewing unpublished article drafts, but the upstream Slugkit site template does not yet include this behavior.

Expected

Generated Slugkit sites should allow authenticated admins to open unpublished article detail pages for preview while keeping drafts hidden from public anonymous users.

Scope

  • Port the slugkit.com behavior into the upstream site template.
  • Enforce access control server-side for /posts/:slug or equivalent public post detail routes.
  • Allow only authenticated users with admin access to preview unpublished articles.
  • Keep unpublished notes/links hidden unless explicitly supported by a separate change.
  • Show a clear draft/unpublished UI indicator on preview pages.
  • Preserve existing published post behavior.

Acceptance criteria

  • Anonymous users cannot view unpublished articles.
  • Non-admin authenticated users cannot view unpublished articles.
  • Authenticated admins can view unpublished article detail pages.
  • Draft/unpublished state is clearly indicated in the UI.
  • Access control is enforced server-side.
  • Published article behavior remains unchanged.
  • Tests cover the new access-control and UI behavior.
## Problem slugkit.com now supports authenticated admin users previewing unpublished article drafts, but the upstream Slugkit site template does not yet include this behavior. ## Expected Generated Slugkit sites should allow authenticated admins to open unpublished article detail pages for preview while keeping drafts hidden from public anonymous users. ## Scope - Port the slugkit.com behavior into the upstream site template. - Enforce access control server-side for `/posts/:slug` or equivalent public post detail routes. - Allow only authenticated users with admin access to preview unpublished articles. - Keep unpublished notes/links hidden unless explicitly supported by a separate change. - Show a clear draft/unpublished UI indicator on preview pages. - Preserve existing published post behavior. ## Acceptance criteria - Anonymous users cannot view unpublished articles. - Non-admin authenticated users cannot view unpublished articles. - Authenticated admins can view unpublished article detail pages. - Draft/unpublished state is clearly indicated in the UI. - Access control is enforced server-side. - Published article behavior remains unchanged. - Tests cover the new access-control and UI behavior.
Author
Owner

Synced from todu comment by @todu on 2026-06-28T11:52:30.289Z

Review update

  • PR: #224 is open with Forgejo CI passing.
  • Result: approved.
  • Follow-up: waiting for explicit human merge approval.

Acceptance criteria: 7/7 met. Blocking issues: 0. Warnings: 0.

_Synced from todu comment by @todu on 2026-06-28T11:52:30.289Z_ ### Review update - PR: https://forge.caradoc.com/erik/slugkit/pulls/224 is open with Forgejo CI passing. - Result: approved. - Follow-up: waiting for explicit human merge approval. Acceptance criteria: 7/7 met. Blocking issues: 0. Warnings: 0.
erik 2026-06-28 07:11:10 -05:00
Author
Owner

Synced from todu comment by @todu on 2026-06-28T12:05:35.187Z

Closing summary

  • PR #224 was merged into main.
  • Local main is aligned with origin/main at merge commit f0298dc.
  • Prior review recorded Forgejo CI passing, approval, and acceptance criteria 7/7 met.

Acceptance criteria verified:

  • Anonymous users cannot view unpublished articles.
  • Non-admin authenticated users cannot view unpublished articles.
  • Authenticated admins can view unpublished article detail pages.
  • Draft/unpublished state is clearly indicated in the UI.
  • Access control is enforced server-side.
  • Published article behavior remains unchanged.
  • Tests cover the new access-control and UI behavior.

Closing task as done.

_Synced from todu comment by @todu on 2026-06-28T12:05:35.187Z_ ### Closing summary - PR #224 was merged into `main`. - Local `main` is aligned with `origin/main` at merge commit `f0298dc`. - Prior review recorded Forgejo CI passing, approval, and acceptance criteria 7/7 met. Acceptance criteria verified: - Anonymous users cannot view unpublished articles. - Non-admin authenticated users cannot view unpublished articles. - Authenticated admins can view unpublished article detail pages. - Draft/unpublished state is clearly indicated in the UI. - Access control is enforced server-side. - Published article behavior remains unchanged. - Tests cover the new access-control and UI behavior. Closing task as done.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit#216
No description provided.