ZDDC/zddc/internal
ZDDC 1c0777a847 feat(zddc): IsAdminForChain — single helper for admin authority
Pure cascade-walk admin check that replaces IsAdmin (root only) +
IsSubtreeAdmin (cascading) + CanEditZddc (strict-ancestor) under one
signature once callers migrate.

  IsAdminForChain(chain, email, excludeLeaf bool) bool

- chain is built for the request path, so subtree-admin scope falls
  out naturally (a chain rooted at /foo/ will only surface admins:
  entries at root and any level up to /foo/).
- email "" never matches (anonymous refusal).
- excludeLeaf=true drops the deepest level — implements the strict-
  ancestor rule for .zddc edits. At chain length 1 (root) the
  exclusion degenerates, preserving the bootstrap super-admin path.
- Elevation-INDEPENDENT — the caller wires Principal.Elevated around
  the result. Keeps this function a pure cascade query, testable
  without context plumbing.

Property tests pin: super-admin matches at depth; subtree admin
matches inside scope, blocked outside; excludeLeaf hides leaf admins
(self-elevation prevention); excludeLeaf at root falls back to root;
empty email refused; role references in admins resolve through the
chain; role defined at leaf is invisible above under excludeLeaf.

Old IsAdmin / IsSubtreeAdmin / CanEditZddc stay in place during the
migration — next commits move callers across, last commit removes
them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 09:14:44 -05:00
..
apps refactor: unified listing protocol + form-editor retirement + admin elevation 2026-05-14 12:15:07 -05:00
archive refactor(archive): use shared zddc.ParseTransmittalFolder 2026-05-07 09:14:19 -05:00
auth feat(server): self-issued bearer tokens + --no-auth flag 2026-05-08 07:40:28 -05:00
cache fix(cache): root-escape guard in mirror walker purgeOrphans 2026-05-09 09:10:14 -05:00
config feat(convert): support remote podman mode + configurable scratch dir 2026-05-13 12:17:40 -05:00
convert fix(pandoc): print CSS — content overflowing the right page margin 2026-05-13 13:48:41 -05:00
fs feat: reviewing/ lifecycle — Plan Review endpoint, virtual received window, browse context-menu workflows 2026-05-15 16:08:04 -05:00
handler test(handler): lock-in invariants for admin/elevation/WORM behavior 2026-05-18 09:12:37 -05:00
jsonschema feat: form-data system v0 (sixth tool + zddc-server endpoints) 2026-05-02 20:12:16 -05:00
listing refactor: unified listing protocol + form-editor retirement + admin elevation 2026-05-14 12:15:07 -05:00
policy feat(zddc): WORM as a cascade key (worm:), retiring hardcoded path predicates 2026-05-12 08:29:11 -05:00
tlsutil feat(server): TLS hardening per NIST SP 800-52 Rev. 2 + HSTS 2026-05-04 17:55:52 -05:00
zddc feat(zddc): IsAdminForChain — single helper for admin authority 2026-05-18 09:14:44 -05:00
zipfs feat(zddc): serve a .zip as a virtual directory (zipfs + dispatch intercept) 2026-05-12 12:17:47 -05:00