MCPcopy Index your code
hub / github.com/simstudioai/sim / getOrganizationOwnerId

Function getOrganizationOwnerId

apps/sim/lib/workspaces/policy.ts:383–391  ·  view source on GitHub ↗
(organizationId: string)

Source from the content-addressed store, hash-verified

381 * silently fallen back to the caller's identity.
382 */
383export async function getOrganizationOwnerId(organizationId: string): Promise<string | null> {
384 const [ownerMembership] = await db
385 .select({ userId: member.userId })
386 .from(member)
387 .where(and(eq(member.organizationId, organizationId), eq(member.role, 'owner')))
388 .limit(1)
389
390 return ownerMembership?.userId ?? null
391}
392
393/**
394 * Like `getOrganizationOwnerId` but throws when no owner row exists.

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected