feat(webui): act in a selected organisation the caller is a member of, enforced at the dashboard and the State Store

This commit is contained in:
sam committed 2026-10-27 11:06:18 +11:00
1 parent 2cf9d435cc
commit 2fb0084d2c
17 files changed
+356 -69

No files matched your search

+4
View File
@@ -190,6 +190,10 @@ export const api = {
scheduleRuns: <T = unknown>(id: string) =>
request<T>(`/api/schedules/${encodeURIComponent(id)}/runs`),
orgs: <T = unknown>() => request<T>("/api/orgs"),
// orgSelect sets the org the caller's tasks, workflows and settings act in;
// the server refuses one the caller is not a member of.
orgSelect: (id: string) =>
request<void>("/api/orgs/current", { method: "PUT", body: { id }, parse: false }),
// orgCreate makes an org with its default workspace and first owner; only
// an instance admin may.
orgCreate: <T = unknown>(org: { id: string; name: string; owner_identity: string }) =>