Timeline: curator event create/edit forms (#781) #832

Merged
marcel merged 29 commits from feat/issue-781-timeline-curator-forms into main 2026-06-14 10:09:13 +02:00
Showing only changes of commit 719274ef88 - Show all commits

View File

@@ -20,6 +20,10 @@ export function hasWriteAll(locals: PermissionLocals): boolean {
* — `hasWriteAll` returns false for a null user, so a single check covers both
* the unauthenticated and the under-privileged case. Server-side gate; the
* frontend canWrite flag only hides entry-point buttons.
*
* Other WRITE_ALL-gated author loads (e.g. `documents/[id]/edit`) still inline
* `if (!hasWriteAll(locals)) throw error(403)` — they can adopt this helper so
* the guard doesn't quietly diverge across routes.
*/
export function requireWriteAll(locals: PermissionLocals): void {
if (!hasWriteAll(locals)) throw error(403, 'Forbidden');