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

Function activeMembershipFromMirror

apps/cloud/src/auth/organization.ts:175–182  ·  view source on GitHub ↗
(userId: string, organizationId: string)

Source from the content-addressed store, hash-verified

173
174// The mirror read: the caller's row, active or nothing.
175const activeMembershipFromMirror = (userId: string, organizationId: string) =>
176 Effect.gen(function* () {
177 const directory = yield* MemberDirectory;
178 const membership = yield* directory.membership(userId, organizationId);
179 if (!membership || membership.status !== "active") return null;
180 const active: ActiveMembership = { role: membership.role };
181 return active;
182 });
183
184// The authorized organization, or null for one marked deleted (unless the
185// caller is the deletion flow). The membership already names the caller's

Callers 1

authorizeOrganizationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected