From 2e6b295ee483ef42e1fddbccb05629a5cbdfe900 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Thu, 8 Oct 2020 14:10:00 -0400 Subject: [PATCH] Fix type check --- api/src/services/authorization.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/services/authorization.ts b/api/src/services/authorization.ts index e52a71f317..f169d7f6b6 100644 --- a/api/src/services/authorization.ts +++ b/api/src/services/authorization.ts @@ -105,15 +105,15 @@ export class AuthorizationService { const allowedFields = permissions.fields?.split(',') || []; - for (const childAST of ast.children) { - if (childAST.type !== 'field') { - validateFields(childAST); + for (const childNode of ast.children) { + if (childNode.type !== 'field') { + validateFields(childNode); continue; } if (allowedFields.includes('*')) continue; - const fieldKey = childAST.name; + const fieldKey = childNode.name; if (allowedFields.includes(fieldKey) === false) { throw new ForbiddenException(