Support the read-only calendar role, show "Vorstand", fix link buttons
- 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:
16 files changed
+155
-32
No files matched your search
@@ -66,6 +66,9 @@ around:
|
||||
- This app can never read or verify the session. It calls `GET /admin/me` and believes the
|
||||
answer; the API's `requireAppAccess('calendar')` is the actual gate. `/admin/me` answers 200
|
||||
for an account without the calendar permission - check `apps`.
|
||||
- A calendar grant is `access` (may change things) or `read` (only look). Hide write controls
|
||||
with `useCanEdit()` / `canEditCalendar` (`lib/permissions.ts`), which mirrors the API's
|
||||
`canWrite`. Any new write control must check it.
|
||||
- 401 and 403 mean different things and must not be collapsed. 401 means "nobody is signed
|
||||
in" and is the only one worth redirecting to the login page - redirecting on 403 produces a
|
||||
loop where signing in succeeds and lands straight back on the refusal. See `app/admin/layout.tsx`.
|
||||
|
||||
Reference in new issue
Block a user