@@ -107,6 +107,7 @@ import { createIntegrationCredentialVisibility } from '@/lib/integrations/creden
107107import { getKnowledgeBases } from '@/lib/knowledge/service'
108108import { validateMermaidSource } from '@/lib/mermaid/validate'
109109import { isBlockTypeAccessControlExempt } from '@/lib/permission-groups/block-access'
110+ import { intersectIntegrationAllowlists } from '@/lib/permission-groups/integration-allowlist'
110111import { getWorkspaceShares } from '@/lib/public-shares/share-manager'
111112import { listTables } from '@/lib/table/service'
112113import { listWorkspaceFileFolders } from '@/lib/uploads/contexts/workspace/workspace-file-folder-manager'
@@ -804,8 +805,10 @@ export class WorkspaceVFS {
804805
805806 // Per-viewer gating happens HERE, not in the shared builder: files
806807 // owned by blocks hidden for this viewer are skipped at stamp time.
807- const configuredAllowedIntegrations =
808- permissionConfig ?. allowedIntegrations ?? getAllowedIntegrationsFromEnv ( )
808+ const configuredAllowedIntegrations = intersectIntegrationAllowlists (
809+ permissionConfig ?. allowedIntegrations ?? null ,
810+ getAllowedIntegrationsFromEnv ( )
811+ )
809812 const allowedIntegrationTypes = configuredAllowedIntegrations
810813 ? new Set ( configuredAllowedIntegrations . map ( ( type ) => type . toLowerCase ( ) ) )
811814 : null
@@ -2361,8 +2364,10 @@ export class WorkspaceVFS {
23612364 getPersonalAndWorkspaceEnv ( userId , workspaceId ) ,
23622365 permissionConfigPromise ,
23632366 ] )
2364- const configuredAllowedIntegrations =
2365- permissionConfig ?. allowedIntegrations ?? getAllowedIntegrationsFromEnv ( )
2367+ const configuredAllowedIntegrations = intersectIntegrationAllowlists (
2368+ permissionConfig ?. allowedIntegrations ?? null ,
2369+ getAllowedIntegrationsFromEnv ( )
2370+ )
23662371 const credentialVisibility = createIntegrationCredentialVisibility ( {
23672372 allowedIntegrationTypes : configuredAllowedIntegrations
23682373 ? new Set ( configuredAllowedIntegrations . map ( ( type ) => type . toLowerCase ( ) ) )
0 commit comments