MCPcopy
hub / github.com/simstudioai/sim / isWorkspaceApiExecutionEntitled

Function isWorkspaceApiExecutionEntitled

apps/sim/lib/billing/core/api-access.ts:38–45  ·  view source on GitHub ↗
(
  workspaceId: string | undefined
)

Source from the content-addressed store, hash-verified

36 * lookup, so the billed-account query only runs when billing is enforced.
37 */
38export async function isWorkspaceApiExecutionEntitled(
39 workspaceId: string | undefined
40): Promise<boolean> {
41 if (!isApiExecutionGateActive() || !workspaceId) return true
42
43 const billedUserId = await getWorkspaceBilledAccountUserId(workspaceId)
44 return isApiExecutionEntitled(billedUserId ?? undefined)
45}

Callers 5

api-access.test.tsFile · 0.90
handleExecutePostFunction · 0.90
assertChatEmbedAllowedFunction · 0.90
authorizeMcpServeRequestFunction · 0.90
handleWebhookPostFunction · 0.90

Calls 3

isApiExecutionGateActiveFunction · 0.85
isApiExecutionEntitledFunction · 0.85

Tested by

no test coverage detected