Domain module: effective visibility and permissions #7

Closed
opened 2026-11-01 16:19:33 +01:00 by miko · 1 comment
Owner

Part of #1

Blocked by: #6

What

One deep module answering "may this user see / do X with this guide or category?". See ADR-0002 and ADR-0003. Build test-first.

Rules

  • Effective visibility = most restrictive along the chain of ancestors including itself
  • Guests see published public content only; viewers additionally internal content
  • Authors edit guides they own; in wiki mode every author may do everything the owner can (incl. delete, visibility, unpublish, toggle wiki mode)
  • Admins may do everything; only admins manage categories, child order and ownership transfer
  • Drafts visible to owner and admins, plus all authors while wiki mode is on

Acceptance criteria

  • Pure functions / a small interface used by pages, route handlers, search and the media route
  • Vitest coverage for every rule above, including edge cases (owner lost author role, internal ancestor of a public guide)

Vocabulary: GLOSSARY.md. Decisions: docs/adr/.

Part of #1 Blocked by: #6 ## What One deep module answering "may this user see / do X with this guide or category?". See ADR-0002 and ADR-0003. Build test-first. ## Rules - Effective visibility = most restrictive along the chain of ancestors including itself - Guests see published public content only; viewers additionally internal content - Authors edit guides they own; in wiki mode every author may do everything the owner can (incl. delete, visibility, unpublish, toggle wiki mode) - Admins may do everything; only admins manage categories, child order and ownership transfer - Drafts visible to owner and admins, plus all authors while wiki mode is on ## Acceptance criteria - [ ] Pure functions / a small interface used by pages, route handlers, search and the media route - [ ] Vitest coverage for every rule above, including edge cases (owner lost author role, internal ancestor of a public guide) Vocabulary: `GLOSSARY.md`. Decisions: `docs/adr/`.
Author
Owner

Implemented in MR #20 (src/permissions/permissions.ts).

Implemented in MR #20 (src/permissions/permissions.ts).
miko closed this issue 2026-11-01 18:06:06 +01:00
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
MassiveDynamic/kataba#7
No description provided.