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

Function verifyWorkspaceMembership

apps/sim/app/api/workflows/utils.ts:70–82  ·  view source on GitHub ↗
(
  userId: string,
  workspaceId: string
)

Source from the content-addressed store, hash-verified

68 * @returns Permission type if user has access, null otherwise
69 */
70export async function verifyWorkspaceMembership(
71 userId: string,
72 workspaceId: string
73): Promise<string | null> {
74 try {
75 const permission = await getUserEntityPermissions(userId, 'workspace', workspaceId)
76
77 return permission
78 } catch (error) {
79 logger.error(`Error verifying workspace permissions for ${userId} in ${workspaceId}:`, error)
80 return null
81 }
82}

Callers 11

route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
handleWorkspaceSchedulesFunction · 0.90
route.tsFile · 0.90
fetchAndAuthorizeFunction · 0.90
route.tsFile · 0.90

Calls 2

getUserEntityPermissionsFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected