Julien Gautier 283c68d7f0
CI / scan (pull_request) Successful in 4m41s
CI / commits (pull_request) Successful in 5m20s
CI / check (pull_request) Failing after 5m34s
CI / a11y (pull_request) Successful in 3m6s
CI / perf (pull_request) Successful in 9m11s
feat(admin): add /admin/users/:oid/scopes screen + endpoints (ADR-0026 PR 2b)
Backend
-------
New REST surface at /api/admin/users/:oid/scopes guarded by
@RequireAdmin (Portal.Admin privilege per ADR-0020). Three endpoints:

  GET    list a user's scopes with the linked User + Person info
         (no audit on reads)
  POST   grant a new scope - validates kind via SCOPE_KINDS catalogue,
         validates value against Structure.code / Delegation.code /
         Region.code for value-bearing kinds, rejects non-empty values
         for valueless kinds, translates Prisma P2002 to a 400 with
         "already granted"; emits admin.scope_granted (blocking
         audit per ADR-0013)
  DELETE :scopeId  404-protected against cross-user revocation;
         emits admin.scope_revoked with the resolved tuple at the
         moment of deletion

Two new audit types (AdminScopeGrantedInput / AdminScopeRevokedInput)
+ two AuditWriter methods. subject = "user:<oid>" so an auditor
pivots on the target of the change.

UserScope rows created here use source = "admin-ui" (distinct from
seed-written "seed" and Person-only "self-signin").

Frontend
--------
New Angular page at /admin/users/:oid/scopes (lazy-loaded). Lists
current scopes in a table with per-row Revoke buttons; "Grant a new
scope" form with kind dropdown + conditional value input + optional
expiresAt datetime. Friendly error mapping: 403 -> "no admin access",
404 -> "User not found, has this persona ever signed in or been
seeded?", server messages forwarded.

A11y per ADR-0016: aria-labelledby on form sections, role="status"
/ aria-live="polite" for load/error feedback, role="alert" for
submit errors, min-height 44px on every input/button, aria-label
on the Manage-scopes link carrying the user's displayName,
conditional aria-required + aria-describedby on the value input.

"Manage scopes" link added to each row of the existing /admin/users
list, navigating to the new page via the user's Entra oid.

Local: drift gate 4/24/7/3 clean; portal-bff lint 0 err; portal-admin
lint 0 err; both test suites green (portal-admin 71 tests, +8 for
user-scopes).

Closes the ADR-0026 trilogy alongside PRs #232 and #233. ADR-0025's
@RequireScope stack is now end-to-end live for the test tenant.
2026-05-26 15:39:50 +02:00

Documentation index

This is the entry point to all project documentation. It is maintained automatically: any addition, rename, or removal of a .md file under docs/ must be reflected here in the same change.

Conventions

  • Documentation is written in English.
  • One topic per file. Group related files into a folder when there are three or more.
  • Cross-reference with relative links so they keep working in GitHub, IDEs, and exported sites.
  • For architectural decisions, do not add them here — they belong in decisions/ as MADR 4.0.0 ADRs.

Sections

Daily development

  • development.md — repo layout, prerequisites, initial setup, daily commands, observability dev-loop (Jaeger UI, log ↔ trace correlation), dependency updates (Renovate), conventional commit cycle. Day-to-day reference for working on the project.

Architecture

  • architecture.md — cross-cutting Mermaid diagrams: C4 system context, C4 containers, Nx module boundaries, CI/CD pipeline. Single-decision diagrams (auth sequence, ERD, etc.) live inline in their ADR.

Onboarding & environment

Setup guides for new contributors:

Operations & runbooks

Empty — to be populated when we deploy.

Security, performance, accessibility

Empty — placeholders to be filled with rationale docs alongside their corresponding ADRs.

S
Description
No description provided
Readme 42 MiB
Languages
TypeScript 85.3%
JavaScript 5.4%
SCSS 4.3%
HTML 3.9%
Shell 0.8%
Other 0.3%