Files
atomic-design-poc/src/app/shared/layout/admin-links.ts
T
ehoandClaude Opus 4.8 67802c68b4 feat(admin): runtime feature flags (catalog-in-code, admin toggle, FE+backend)
Catalog declared in code (Domain/Features/FeatureFlags.cs, build-validated), on/off state
persisted in SQLite (FeatureFlagStore + migration). GET /flags (drives FE gating) + admin
PUT /admin/flags/{key} (new flags:manage capability + FlagsAdmin gate). Enforced end-to-end:
the `inschrijving-open` flag hides the Inschrijven nav item + dashboard action (FE) AND makes
POST /applications for a registratie 403 when off (backend). FE FeatureFlagStore mirrors
AccessStore (enabled() deny-by-default); admin toggle page at /beheer/functies in ADMIN_LINKS.
+4 backend tests, /me cap-list updated, client regenerated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 22:29:48 +02:00

47 lines
1.7 KiB
TypeScript

import { Capability } from '@shared/domain/capability';
/** One admin page: its label, a short description, its route, and the capability that
gates it. Single source of truth for "which admin pages exist" — consumed by the site
header's admin nav AND the dashboard's Beheer section, both filtered by `AccessStore.can`.
Capability-gated, never role-derived (PRD-0002 §6): the FE only mirrors server-resolved
capabilities, so this stays correct when real authz replaces the X-Role stub. */
export interface AdminLink {
readonly label: string;
readonly description: string;
readonly to: string;
readonly cap: Capability;
}
export const ADMIN_LINKS: readonly AdminLink[] = [
{
label: $localize`:@@header.nav.huisstijl:Huisstijl`,
description: $localize`:@@admin.link.huisstijl.desc:Organisatiesjablonen voor brieven beheren`,
to: '/brief/huisstijl',
cap: 'orgtemplate:edit',
},
{
label: $localize`:@@header.nav.stamdata:Stamdata`,
description: $localize`:@@admin.link.stamdata.desc:Business-tabellen onderhouden`,
to: '/beheer/stamdata',
cap: 'stamdata:edit',
},
{
label: $localize`:@@header.nav.zaken:Aanvragen`,
description: $localize`:@@admin.link.zaken.desc:Alle aanvragen bekijken en beheren`,
to: '/beheer/zaken',
cap: 'cases:manage',
},
{
label: $localize`:@@header.nav.audit:Auditlog`,
description: $localize`:@@admin.link.audit.desc:Toegangs- en inzagebeslissingen bekijken`,
to: '/beheer/audit',
cap: 'cases:manage',
},
{
label: $localize`:@@header.nav.functies:Functievlaggen`,
description: $localize`:@@admin.link.functies.desc:Functionaliteit aan- of uitzetten`,
to: '/beheer/functies',
cap: 'flags:manage',
},
];