fix(core): Fix broken API permissions in public API (#5978)

This commit is contained in:
Omar Ajoue
2023-04-14 11:05:42 +02:00
committed by GitHub
parent 536d8109b0
commit 49d838f628
3 changed files with 142 additions and 6 deletions

View File

@@ -91,7 +91,7 @@ export = {
// user does not have workflows hence no executions
// or the execution he is trying to access belongs to a workflow he does not own
if (!sharedWorkflowsIds.length) {
if (!sharedWorkflowsIds.length || (workflowId && !sharedWorkflowsIds.includes(workflowId))) {
return res.status(200).json({ data: [], nextCursor: null });
}
@@ -105,7 +105,7 @@ export = {
limit,
lastId,
includeData,
...(workflowId && { workflowIds: [workflowId] }),
workflowIds: workflowId ? [workflowId] : sharedWorkflowsIds,
excludedExecutionsIds: runningExecutionsIds,
};