MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / requireAdmin

Function requireAdmin

apps/host-selfhost/src/admin/handlers.ts:41–46  ·  view source on GitHub ↗
(headers: Headers)

Source from the content-addressed store, hash-verified

39// plane's error vocabulary (the HttpApi group declares these, not the users
40// plane's).
41const requireAdmin = (headers: Headers) =>
42 requireInstanceAdmin(headers).pipe(
43 Effect.mapError((denial) =>
44 denial === "unauthorized" ? new AdminUnauthorized() : new AdminForbidden(),
45 ),
46 );
47
48const narrowRole = (role: string | undefined): InviteRole =>
49 role === "admin" ? "admin" : "member";

Callers 1

handlers.tsFile · 0.70

Calls 1

requireInstanceAdminFunction · 0.90

Tested by

no test coverage detected