Commit dbe0a69
committed
SEP-1844: Gate the snippet execute form on the capability, not the query flag
Address review feedback.
The snippet accordion withheld its execute form from a read-only session
by disabling the schema query, but a disabled query still serves a cached
entry. The schema is held with `staleTime: Infinity` under a key carrying
no identity, and the shell never clears the query cache, so an admin's
fetch would render the form for a non-admin opening the same snippet
later in the same tab. The render now gates on `canMutate` as well; the
query flag stays as the request optimization. Covered by a test that
populates the cache as an admin and re-renders read-only, which fails
without the render gate.
Also restores two e2e session fixtures to non-admin. The snippet-download
spec exercises a GET that stays permitted, and the sidebar-navigation
specs only navigate and assert readable sentinels, so leaving both
non-admin keeps end-to-end coverage of the read-only experience this
change creates rather than broadening privileges the specs never use.1 parent f20e939 commit dbe0a69
4 files changed
Lines changed: 44 additions & 8 deletions
File tree
- frontend/packages
- e2e/tests
- framework/src/components/SnippetExecutionAccordion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
531 | 560 | | |
532 | 561 | | |
533 | 562 | | |
| |||
frontend/packages/framework/src/components/SnippetExecutionAccordion/SnippetExecutionAccordion.tsx
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| |||
225 | 230 | | |
226 | 231 | | |
227 | 232 | | |
228 | | - | |
| 233 | + | |
229 | 234 | | |
230 | 235 | | |
231 | 236 | | |
| |||
0 commit comments