Support the read-only calendar role, show "Vorstand", fix link buttons
Test and deploy / test (pull_request) Successful in 2m18s
Test and deploy / deploy (pull_request) Skipped

- Read-only role: /admin/me's permissions decide via canEditCalendar
  (lib/permissions.ts, mirrors the API's canWrite: only `access` writes).
  Read-only accounts see everything but get no "Neuer Termin", no "+", no
  "Veröffentlichen"; an event opens as "Termin ansehen" with locked fields.
  A "Nur lesen" badge in the header explains why. The API refuses their
  writes regardless.
- The management calendar is labelled "Vorstand"; the slug stays
  `management` for the API, URLs and iCal links.
- The subscription dialog's Apple/Google links are plain anchors styled with
  buttonVariants instead of Base UI Buttons rendering an <a>, which warned in
  dev and would have given them role="button".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PaddyandClaude Opus 5.5 committed 2026-11-08 22:15:31 +01:00
1 parent 1971d2bd6f
commit 61e0393f01
16 files changed
+155 -32

No files matched your search

+8
View File
@@ -32,6 +32,14 @@ the **API** sets on `.nachklang.art`; it is shared by calendar, feedback, ticket
`GET /admin/me` answers **200** for an account without the calendar permission; only `apps` shows
it. The layout's `apps.includes("calendar")` check is load-bearing.
**Read-only role.** `/admin/me` also returns `permissions: [{app, role}]`. `lib/permissions.ts`
(`canEditCalendar`) mirrors the API's `canWrite`: only a calendar grant with role `access` may
change anything; `read` - or any role the app doesn't know - is read-only. Without `permissions`
(an API from before the role) it falls back to `apps`. The UI reads it through `useCanEdit()`
(`AdminSession.tsx`) and hides every write control; `EventSheet` turns into a view. Enforcement
is the API's: `requireAppAccess` refuses non-GET requests from `read` grants with 403. See the
API's `docs/admin-roles.md`.
## Data flow (admin)
- `components/admin/useEvents.ts` loads all five calendars in parallel from