diff --git a/packages/backend/src/graphql/queries/get-execution-steps.ts b/packages/backend/src/graphql/queries/get-execution-steps.ts index 8267dbd7..01394dbe 100644 --- a/packages/backend/src/graphql/queries/get-execution-steps.ts +++ b/packages/backend/src/graphql/queries/get-execution-steps.ts @@ -12,6 +12,8 @@ const getExecutionSteps = async ( params: Params, context: Context ) => { + context.currentUser.can('read', 'Execution'); + const execution = await context.currentUser .$relatedQuery('executions') .withSoftDeleted() diff --git a/packages/backend/src/graphql/queries/get-execution.ts b/packages/backend/src/graphql/queries/get-execution.ts index 550385bc..19ff929e 100644 --- a/packages/backend/src/graphql/queries/get-execution.ts +++ b/packages/backend/src/graphql/queries/get-execution.ts @@ -9,6 +9,8 @@ const getExecution = async ( params: Params, context: Context ) => { + context.currentUser.can('read', 'Execution'); + const execution = await context.currentUser .$relatedQuery('executions') .withGraphFetched({ diff --git a/packages/backend/src/graphql/queries/get-executions.ts b/packages/backend/src/graphql/queries/get-executions.ts index ee261f1b..90d96517 100644 --- a/packages/backend/src/graphql/queries/get-executions.ts +++ b/packages/backend/src/graphql/queries/get-executions.ts @@ -12,6 +12,8 @@ const getExecutions = async ( params: Params, context: Context ) => { + context.currentUser.can('read', 'Execution'); + const selectStatusStatement = ` case when count(*) filter (where execution_steps.status = 'failure') > 0