|
215 | 215 | * |
216 | 216 | * Scope in the other direction: this guard watches writes to the four tables |
217 | 217 | * the administrator population is derived from, and stops there. It has no |
218 | | - * opinion on what a permission set CONTAINS — emptying `admin_full_access`'s |
219 | | - * `system_permissions` would leave administrators who administer nothing, but |
220 | | - * that is a capability question (ADR-0086), and answering it here would make |
221 | | - * every permission-set edit in Setup a break-glass decision. "Who is an |
222 | | - * administrator" is resolved by NAME in this codebase (`resolveAuthzContext`, |
223 | | - * ADR-0068 D2), so the guard reads exactly the name. |
| 218 | + * opinion on what a permission set CONTAINS, and that is not a gap being left |
| 219 | + * open — it was measured. `resolveAuthzContext` sets `hasPlatformAdminGrant` |
| 220 | + * from `ps.name === 'admin_full_access'` alone and `derivePosture` returns |
| 221 | + * `PLATFORM_ADMIN` off that boolean, so emptying the set's |
| 222 | + * `system_permissions` does NOT un-make a platform admin: the posture rung and |
| 223 | + * the superuser bypass ride on the NAME (ADR-0068 D2 / ADR-0095 D3). Such an |
| 224 | + * edit costs the holder `setup.access` / `studio.access` — Setup and Studio go |
| 225 | + * invisible — while the data plane still answers, so it is recoverable from |
| 226 | + * inside the product and is a capability question (ADR-0086), not a break-glass |
| 227 | + * one. The name is the whole of what makes an administrator here, so the name |
| 228 | + * is the whole of what this guard reads. |
224 | 229 | * |
225 | 230 | * ## Relationship to the ADR-0092 identity write guard |
226 | 231 | * |
@@ -544,9 +549,10 @@ const GRANT_STANDING_KEYS = [ |
544 | 549 | * because the platform-admin half of the enumeration reads exactly one column |
545 | 550 | * of that table: the `name` it looks the set up by. Everything else a |
546 | 551 | * permission-set write touches (`label`, `description`, the four permission |
547 | | - * JSON blobs, `active`, provenance) is invisible to "who is an administrator", |
548 | | - * so those writes — which is every projection pass and every Setup edit — cost |
549 | | - * this guard no reads at all. |
| 552 | + * JSON blobs, `active`, provenance) is invisible to "who is an administrator" — |
| 553 | + * `resolveAuthzContext` derives `platform_admin` from the NAME, not from the |
| 554 | + * capabilities the set carries — so those writes, which is every projection |
| 555 | + * pass and every Setup edit, cost this guard no reads at all. |
550 | 556 | * |
551 | 557 | * `id` is deliberately NOT here even though the enumeration reads it. On this |
552 | 558 | * engine `data.id` on an update ADDRESSES the row (it is what |
|
0 commit comments