Fix type check

This commit is contained in:
rijkvanzanten
2020-10-08 14:10:00 -04:00
parent 34323d48fc
commit 2e6b295ee4

View File

@@ -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(