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

Function hasWriteAccess

apps/sim/lib/resources/orchestration/restore-resource.ts:39–47  ·  view source on GitHub ↗
(
  userId: string,
  callerWorkspaceId: string,
  resourceWorkspaceId: string | null | undefined
)

Source from the content-addressed store, hash-verified

37}
38
39async function hasWriteAccess(
40 userId: string,
41 callerWorkspaceId: string,
42 resourceWorkspaceId: string | null | undefined
43): Promise<boolean> {
44 if (!resourceWorkspaceId || resourceWorkspaceId !== callerWorkspaceId) return false
45 const permission = await getUserEntityPermissions(userId, 'workspace', resourceWorkspaceId)
46 return permission === 'write' || permission === 'admin'
47}
48
49function success(
50 output: Record<string, unknown>,

Callers 1

performRestoreResourceFunction · 0.85

Calls 1

getUserEntityPermissionsFunction · 0.90

Tested by

no test coverage detected