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

Function getPermissionConfig

apps/sim/ee/access-control/utils/permission-check.ts:325–346  ·  view source on GitHub ↗

* Cache-aware wrapper around `getUserPermissionConfig`. When an * `ExecutionContext` is provided, the resolved config is memoized on the * context so repeated checks during a single workflow run share one DB hit.

(
  userId: string | undefined,
  workspaceId: string | undefined,
  ctx?: ExecutionContext
)

Source from the content-addressed store, hash-verified

323 * context so repeated checks during a single workflow run share one DB hit.
324 */
325async function getPermissionConfig(
326 userId: string | undefined,
327 workspaceId: string | undefined,
328 ctx?: ExecutionContext
329): Promise<PermissionGroupConfig | null> {
330 if (!userId || !workspaceId) {
331 return mergeEnvAllowlist(null)
332 }
333
334 if (ctx) {
335 if (ctx.permissionConfigLoaded) {
336 return ctx.permissionConfig ?? null
337 }
338
339 const config = await getUserPermissionConfig(userId, workspaceId)
340 ctx.permissionConfig = config
341 ctx.permissionConfigLoaded = true
342 return config
343 }
344
345 return getUserPermissionConfig(userId, workspaceId)
346}
347
348/**
349 * Returns true when `model` appears in the group's model denylist. Comparison is

Callers 6

validateModelProviderFunction · 0.85
validateBlockTypeFunction · 0.85
validateMcpToolsAllowedFunction · 0.85
validateSkillsAllowedFunction · 0.85
assertPermissionsAllowedFunction · 0.85

Calls 2

mergeEnvAllowlistFunction · 0.85
getUserPermissionConfigFunction · 0.85

Tested by

no test coverage detected