refactor: Adjust credential endpoints permissions (#4656) (no-changelog)

* refactor: Adjust credential endpoints permissions
This commit is contained in:
Omar Ajoue
2022-11-22 08:37:52 +01:00
committed by GitHub
parent fe0178150f
commit 4c423762d6
5 changed files with 76 additions and 20 deletions

View File

@@ -247,13 +247,14 @@ EEWorkflowController.post(
const workflow = new WorkflowEntity();
Object.assign(workflow, req.body.workflowData);
const safeWorkflow = await EEWorkflows.preventTampering(
workflow,
workflow.id.toString(),
req.user,
);
req.body.workflowData.nodes = safeWorkflow.nodes;
if (workflow.id !== undefined) {
const safeWorkflow = await EEWorkflows.preventTampering(
workflow,
workflow.id.toString(),
req.user,
);
req.body.workflowData.nodes = safeWorkflow.nodes;
}
return EEWorkflows.runManually(req.body, req.user, GenericHelpers.getSessionId(req));
}),