From 72b81cae5e7be5e78eabda8dfe5e1feb0d69ff4f Mon Sep 17 00:00:00 2001 From: Sebastian Seedorf Date: Sun, 15 Nov 2020 22:33:36 +0100 Subject: [PATCH] Added "noaccess" handler --- src/utils/permissions.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/permissions.ts b/src/utils/permissions.ts index ee02af4..93f8833 100644 --- a/src/utils/permissions.ts +++ b/src/utils/permissions.ts @@ -54,6 +54,12 @@ export class PermQuery extends Query { const userInfo = await this.resolveRequest.getUserInfo(); this.role(userInfo?.groups ?? []); } + if ( + typeof this._.role === 'object' && this._.role.includes('noaccess') || + typeof this._.role === 'string' && this._.role === 'noaccess' + ) { + this.role([]); + } return super.on(resource, skipConditions); }