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

Function getUserRole

apps/sim/lib/workspaces/organization/utils.ts:13–22  ·  view source on GitHub ↗
(
  organization: Organization | null | undefined,
  userEmail?: string
)

Source from the content-addressed store, hash-verified

11 * Get the role of a user in an organization
12 */
13export function getUserRole(
14 organization: Organization | null | undefined,
15 userEmail?: string
16): string {
17 if (!userEmail || !organization?.members) {
18 return 'member'
19 }
20 const currentMember = organization.members.find((m) => m.user?.email === userEmail)
21 return currentMember?.role ?? 'member'
22}
23
24/**
25 * Check if a user is an admin or owner in an organization

Callers 7

CredentialSetsFunction · 0.90
SettingsSidebarFunction · 0.90
SSOFunction · 0.90
DataDrainsSettingsFunction · 0.90
DataRetentionSettingsFunction · 0.90
WhitelabelingSettingsFunction · 0.90
isAdminOrOwnerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected