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

Function authorized

apps/cloud/src/auth/organization.ts:189–197  ·  view source on GitHub ↗
(
  org: Organization,
  membership: ActiveMembership,
  options: AuthorizeOrganizationOptions,
)

Source from the content-addressed store, hash-verified

187// workspace write permission without a second read. WorkOS issues `admin` /
188// `member`; anything unrecognized stays a plain member.
189const authorized = (
190 org: Organization,
191 membership: ActiveMembership,
192 options: AuthorizeOrganizationOptions,
193) => {
194 if (org.deletedAt !== null && options.deleted !== "allow") return null;
195 const memberRole: "admin" | "member" = membership.role === "admin" ? "admin" : "member";
196 return { ...org, memberRole };
197};
198
199// The organization row for a caller, minted from WorkOS when the mirror
200// does not hold it — only for a caller WorkOS confirms as its member (see

Callers 1

authorizeOrganizationFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected