feat(authorization): add read execution checks
This commit is contained in:
@@ -12,6 +12,8 @@ const getExecutionSteps = async (
|
|||||||
params: Params,
|
params: Params,
|
||||||
context: Context
|
context: Context
|
||||||
) => {
|
) => {
|
||||||
|
context.currentUser.can('read', 'Execution');
|
||||||
|
|
||||||
const execution = await context.currentUser
|
const execution = await context.currentUser
|
||||||
.$relatedQuery('executions')
|
.$relatedQuery('executions')
|
||||||
.withSoftDeleted()
|
.withSoftDeleted()
|
||||||
|
@@ -9,6 +9,8 @@ const getExecution = async (
|
|||||||
params: Params,
|
params: Params,
|
||||||
context: Context
|
context: Context
|
||||||
) => {
|
) => {
|
||||||
|
context.currentUser.can('read', 'Execution');
|
||||||
|
|
||||||
const execution = await context.currentUser
|
const execution = await context.currentUser
|
||||||
.$relatedQuery('executions')
|
.$relatedQuery('executions')
|
||||||
.withGraphFetched({
|
.withGraphFetched({
|
||||||
|
@@ -12,6 +12,8 @@ const getExecutions = async (
|
|||||||
params: Params,
|
params: Params,
|
||||||
context: Context
|
context: Context
|
||||||
) => {
|
) => {
|
||||||
|
context.currentUser.can('read', 'Execution');
|
||||||
|
|
||||||
const selectStatusStatement = `
|
const selectStatusStatement = `
|
||||||
case
|
case
|
||||||
when count(*) filter (where execution_steps.status = 'failure') > 0
|
when count(*) filter (where execution_steps.status = 'failure') > 0
|
||||||
|
Reference in New Issue
Block a user