dorfteich/apps/api
Claude Opus 4.8 4d48d72c40
All checks were successful
CD / Build and push images (push) Successful in 3m3s
CI / Lint, typecheck, test (push) Successful in 2m21s
CI / Auth e2e pack (push) Successful in 2m58s
CI / Build container images (push) Has been skipped
CD / Deploy to Test (push) Successful in 9s
CD / Smoke tests against Test (push) Successful in 1m13s
CD / Promote to Int (push) Successful in 11s
Add grant model and shared permission-resolution algorithm (#51)
The heart of the security model: one algorithm, implemented once, for API,
collab, and UI (permissions.md — authoritative).

- shared `permissions/`: pure resolution (`resolvePageCapability`) exactly per
  permissions.md — specificity page > label (incl. ancestor labels) > pond,
  deny wins within a level, default-closed, Site Admin bypass — plus the trash
  rule (`canAccessPage` / `canAccessTrashedPage`, ADR 0013). `grantValidationError`
  enforces the structural constraints. Documented, I/O-free signatures for
  API/collab reuse.
- prisma: `RoleGrant` (+ grant enums) per data-model.md, unique on
  (pond, subject, role, scope); migration adds a CHECK backstop that a
  POND_ADMIN grant is pond-scope + user-subject.
- api `grants/`: `GrantsService.createGrant` validates before insert (structural
  + no extra admin on a personal pond), rejects duplicates; `grantsForPond`
  returns the shared resolver model (what #52/#53 consume); enum mappers between
  the DB and the shared model. Interim "who may manage grants" stays until #52.
- tests: exhaustive table-driven resolver suite — every worked example from
  permissions.md §Resolution, edge cases (multi-label deny-wins, ancestor
  inheritance, anonymous/public, most-specific-allow-beats-less-specific-deny,
  trash) and a property test (a less-specific grant never overrides a
  more-specific decision); validation unit tests; grants db test proving
  write-time rejection of invalid grants.
- i18n: grant error codes (de + en).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PGdhRiwU1WRL4XxJfZYipY
2026-07-09 14:02:07 +02:00
..
prisma Add grant model and shared permission-resolution algorithm (#51) 2026-07-09 14:02:07 +02:00
src Add grant model and shared permission-resolution algorithm (#51) 2026-07-09 14:02:07 +02:00
.swcrc Add NestJS API skeleton with config, logging, and /healthz 2026-07-04 19:10:07 +02:00
Dockerfile Add file storage service and image upload API (#27) 2026-07-08 10:35:03 +02:00
nest-cli.json Add NestJS API skeleton with config, logging, and /healthz 2026-07-04 19:10:07 +02:00
package.json Add SearchProvider interface with PostgreSQL FTS (#49) 2026-07-09 13:25:05 +02:00
tsconfig.build.json Add NestJS API skeleton with config, logging, and /healthz 2026-07-04 19:10:07 +02:00
tsconfig.json Add NestJS API skeleton with config, logging, and /healthz 2026-07-04 19:10:07 +02:00
vitest.config.ts Add user, identity, session, and auth-support data model 2026-07-05 00:42:22 +02:00
vitest.global-setup.ts Add user, identity, session, and auth-support data model 2026-07-05 00:42:22 +02:00