Commit 6029cc1
`buildContextForUser` was a hand-written second implementation of
`@objectstack/core`'s `resolveAuthzContext` aggregation, kept in step by two
comments claiming it mirrored the resolver. Measured over identical rows it did
not: it dropped the `sys_member` role positions, every position-bound permission
set (`sys_position_permission_set`), the `everyone` anchor's bound sets, the
`platform_admin` position projection, `systemPermissions`, the posture rung,
`email` and the `ai_seat` synthesis.
Permission sets resolve BY NAME from `positions` + `permissions`, and a
position-carried set only becomes a name inside the resolver — so any user
granted through a position was explained as holding nothing, and the panel
reported a denial enforcement never made.
It now calls `resolveUserAuthzGrants` and adds presentation only: the ADR-0091
expired / `delegated_from` row annotations the resolver correctly discards, and
`hasPlatformAdminGrant`, read back off the resolver's own posture verdict.
Pinned by a parity suite running both implementations over the same fixture rows
with per-case expected output, so it cannot pass by both sides resolving to
nothing. `check:authz-resolver`'s ALLOW entry is narrowed to what still trips its
heuristic — the explain-only provenance pass — without touching its remit.
Claude-Session: https://claude.ai/code/session_01BM1tNf5U3nEbHKR4fo5qVQ
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 486d526 commit 6029cc1
4 files changed
Lines changed: 499 additions & 165 deletions
File tree
- .changeset
- packages/plugins/plugin-security/src
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments