private isAllowed()

in src/RBACHandler.ts [101:115]


    private isAllowed(groups: string[], operation: TypeOperation | SystemOperation, resourceType?: string): void {
        for (let index = 0; index < groups.length; index += 1) {
            const group: string = groups[index];
            if (this.rules.groupRules[group]) {
                const rule: Rule = this.rules.groupRules[group];
                if (
                    rule.operations.includes(operation) &&
                    ((resourceType && rule.resources.includes(resourceType)) || !resourceType)
                ) {
                    return;
                }
            }
        }
        throw new UnauthorizedError('Unauthorized');
    }