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

Function userCanAccessWorkspace

apps/sim/app/workspace/[workspaceId]/prefetch.ts:14–21  ·  view source on GitHub ↗

Resolves whether the user may access the workspace, swallowing errors to a `false`.

(workspaceId: string, userId: string)

Source from the content-addressed store, hash-verified

12
13/** Resolves whether the user may access the workspace, swallowing errors to a `false`. */
14async function userCanAccessWorkspace(workspaceId: string, userId: string): Promise<boolean> {
15 try {
16 const access = await checkWorkspaceAccess(workspaceId, userId)
17 return access.exists && access.hasAccess
18 } catch {
19 return false
20 }
21}
22
23/**
24 * Prefetches the sidebar's workflow + chat lists for a workspace and stores them

Callers 1

prefetchWorkspaceSidebarFunction · 0.85

Calls 1

checkWorkspaceAccessFunction · 0.90

Tested by

no test coverage detected