feat(authorization): add read execution checks

This commit is contained in:
Ali BARIN
2023-08-03 19:39:48 +02:00
parent 5d77f64e76
commit 8a71c13078
3 changed files with 6 additions and 0 deletions
@@ -12,6 +12,8 @@ const getExecutionSteps = async (
params: Params,
context: Context
) => {
context.currentUser.can('read', 'Execution');
const execution = await context.currentUser
.$relatedQuery('executions')
.withSoftDeleted()
@@ -9,6 +9,8 @@ const getExecution = async (
params: Params,
context: Context
) => {
context.currentUser.can('read', 'Execution');
const execution = await context.currentUser
.$relatedQuery('executions')
.withGraphFetched({
@@ -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