refactor(core): Split out subworkflow policy check from permission checker (no-changelog) (#10168)

This commit is contained in:
Iván Ovejero
2024-07-24 12:51:01 +02:00
committed by GitHub
parent 7848c19f54
commit f1a3791abc
7 changed files with 284 additions and 289 deletions

View File

@@ -73,6 +73,7 @@ import { WorkflowExecutionService } from './workflows/workflowExecution.service'
import { MessageEventBus } from '@/eventbus/MessageEventBus/MessageEventBus';
import { EventService } from './eventbus/event.service';
import { GlobalConfig } from '@n8n/config';
import { SubworkflowPolicyChecker } from './subworkflows/subworkflow-policy-checker.service';
export function objectToError(errorObject: unknown, workflow: Workflow): Error {
// TODO: Expand with other error types
@@ -826,7 +827,7 @@ async function executeWorkflow(
let data;
try {
await Container.get(PermissionChecker).check(workflowData.id, workflowData.nodes);
await Container.get(PermissionChecker).checkSubworkflowExecutePolicy(
await Container.get(SubworkflowPolicyChecker).check(
workflow,
options.parentWorkflowId,
options.node,