Charis
7ce15123ab
feat(studio): grant infra for production and development branch variants ( #52372 )
...
Part 1 of 7 in a stack that splits #52331 into reviewable pieces.
Resolves part of
[FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal ).
There are no functional changes beyond #52331 , and the top of the stack
is identical to it. See #52331 for the full rationale.
## Stack
1. 👉 #52372 Grant infra for branch variants
2. #52373 Branches list query
3. #52374 Page gates on the list grant
4. #52375 Branch creation
5. #52376 Branch read, delete, reset, and restore
6. #52377 Branch update and push
7. #52378 Branch diff and merge
## Changes
Adds `lib/fga-refinements.ts` entries: `production`/`development`
variants for the 8 single-branch endpoints, with a new `variantRequired`
flag. The fetch wrapper and `assertGrant` reject a grant without a
variant. Also adds the `production` variant for `POST
/v1/projects/{ref}/branches` when the body sets `is_default` or
`with_data`. Adds `GrantForVariants`, the `useBranchGrant` hook, and
shared fixtures in `tests/lib/branch-test-utils.ts`. Behavior-neutral:
existing branch calls still use `unguarded.migrating`, which skips these
checks.
## Testing
`guarded-fetch.test.ts` and `useBranchGrant.test.ts`.
2026-10-27 10:48:24 -04:00
..
2026-10-23 18:51:27 +08:00
2026-10-27 12:42:05 +11:00
2026-10-26 09:31:45 -04:00
2026-10-23 09:37:59 -04:00
2026-10-23 18:51:27 +08:00
2026-09-08 18:26:41 +08:00
2026-07-25 00:00:37 +10:00
2026-09-29 15:28:49 -04:00
2026-10-06 15:56:48 -04:00
2026-09-02 19:02:37 +08:00
2026-03-19 11:43:02 +11:00
2026-04-07 20:34:10 -04:00
2025-07-03 12:41:11 +02:00
2026-09-28 18:21:34 +03:00
2026-10-01 12:04:07 +10:00
2026-10-01 12:04:07 +10:00
2026-04-27 17:42:34 +08:00
2025-10-22 08:57:49 -04:00
2026-10-27 20:50:25 +08:00
2026-10-27 20:50:25 +08:00
2026-10-12 10:26:51 +11:00
2026-10-12 10:26:51 +11:00
2026-10-27 14:47:27 +01:00
2026-10-27 14:47:27 +01:00
2026-10-23 18:51:27 +08:00
2026-10-07 09:43:28 -04:00
2026-07-22 13:57:03 +02:00
2026-04-07 20:34:10 -04:00
2026-05-06 14:52:36 +02:00
2026-05-06 14:52:36 +02:00
2026-03-23 21:20:47 +00:00
2026-10-23 18:51:27 +08:00
2026-04-07 20:34:10 -04:00
2026-10-23 18:51:27 +08:00
2026-08-18 15:33:04 +08:00
2026-10-27 10:48:24 -04:00
2026-10-23 18:51:27 +08:00
2026-05-04 13:08:06 -04:00
2026-08-04 09:02:40 -04:00
2026-08-04 09:02:40 -04:00
2026-10-23 18:51:27 +08:00
2026-06-04 07:41:28 -06:00
2026-10-23 18:51:27 +08:00
2026-08-24 17:23:25 +10:00
2026-10-26 10:51:20 -04:00
2026-10-27 10:48:24 -04:00
2026-10-23 18:51:27 +08:00
2026-10-05 09:37:51 -04:00
2026-10-16 14:18:32 -04:00
2026-04-07 20:34:10 -04:00
2025-06-27 11:10:25 +02:00
2026-09-30 12:59:36 +08:00
2026-09-30 12:59:36 +08:00
2026-10-23 18:51:27 +08:00
2026-07-08 14:52:59 +08:00
2026-10-23 18:51:27 +08:00
2025-08-14 21:23:08 +02:00
2026-08-07 13:40:18 +07:00
2026-08-07 13:40:18 +07:00
2026-05-04 07:08:35 -06:00
2026-10-27 12:42:05 +11:00
2026-10-23 18:51:27 +08:00
2026-04-08 16:54:31 +02:00
2026-04-07 20:34:10 -04:00
2024-07-17 13:27:00 +08:00
2026-10-23 18:51:27 +08:00
2026-09-15 10:07:49 +10:00
2026-06-25 11:08:26 -04:00
2026-07-08 14:52:59 +08:00
2026-07-08 14:52:59 +08:00
2026-03-09 15:25:05 +07:00
2026-03-09 15:25:05 +07:00
2026-07-06 17:38:03 +08:00
2026-07-06 17:38:03 +08:00
2026-08-14 14:56:23 +02:00
2026-03-11 13:55:20 +01:00
2026-04-07 20:34:10 -04:00
2026-04-07 20:34:10 -04:00
2026-04-07 20:34:10 -04:00
2026-05-13 14:57:08 -04:00
2026-09-10 16:45:54 +08:00
2026-04-07 20:34:10 -04:00
2026-10-12 11:28:12 +08:00
2026-10-27 09:30:23 -04:00
2026-09-10 16:45:54 +08:00
2026-09-10 16:45:54 +08:00
2026-04-27 17:42:34 +08:00
2026-10-23 18:51:27 +08:00
2026-06-09 08:25:29 -06:00
2024-11-22 16:42:12 +08:00
2026-06-09 08:25:29 -06:00
2026-04-02 11:09:18 +11:00
2025-10-22 08:57:49 -04:00
2025-10-22 08:57:49 -04:00
2026-05-04 13:08:06 -04:00
2026-08-18 11:27:09 +08:00
2026-07-08 14:52:59 +08:00
2026-07-08 14:52:59 +08:00
2026-10-19 21:00:40 +02:00
2026-07-08 14:52:59 +08:00
2025-10-22 08:57:49 -04:00
2025-10-22 08:57:49 -04:00
2026-10-23 18:51:27 +08:00
2026-01-22 11:17:49 -05:00
2026-10-23 18:51:27 +08:00
2026-09-15 09:38:36 -06:00
2026-10-23 18:51:27 +08:00
2026-10-05 18:36:13 +11:00
2026-09-25 15:38:23 +08:00
2026-09-25 15:38:23 +08:00
2026-06-18 15:34:56 +08:00
2026-10-14 12:56:55 +02:00
2026-10-23 18:51:27 +08:00
2026-05-04 16:21:47 +08:00
2026-04-07 20:34:10 -04:00
2026-04-07 20:34:10 -04:00
2026-04-07 20:34:10 -04:00
2026-04-27 17:42:34 +08:00
2026-05-13 14:57:08 -04:00
2026-07-02 11:47:13 +02:00
2026-07-31 15:37:05 -07:00
2026-10-06 10:11:26 +11:00
2026-09-02 19:02:37 +08:00
2026-10-26 09:45:23 +01:00
2026-03-30 10:58:37 +02:00
2026-05-13 14:57:08 -04:00
2026-09-10 16:45:54 +08:00
2026-04-27 17:42:34 +08:00
2026-10-19 15:25:32 +02:00
2026-10-19 15:25:32 +02:00