Added "noaccess" handler

This commit is contained in:
Sebastian Seedorf
2020-11-15 22:33:36 +01:00
parent 2c15f0ba23
commit 72b81cae5e

View File

@@ -54,6 +54,12 @@ export class PermQuery extends Query {
const userInfo = await this.resolveRequest.getUserInfo(); const userInfo = await this.resolveRequest.getUserInfo();
this.role(userInfo?.groups ?? []); 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); return super.on(resource, skipConditions);
} }