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

Function isPlatformAdmin

apps/sim/lib/permissions/super-user.ts:45–53  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

43 * to the primary when no replica is configured.
44 */
45export async function isPlatformAdmin(userId: string): Promise<boolean> {
46 const [row] = await dbReplica
47 .select({ role: user.role })
48 .from(user)
49 .where(eq(user.id, userId))
50 .limit(1)
51
52 return row?.role === 'admin'
53}

Callers 1

resolveAdminFunction · 0.85

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected