const matchingGrants = (this.getUnionGrantsOfRolesSync(grants, query))
            .filter((grant) => {
                return this.anyMatch(query.resource, grant.resource)
                    && this.anyMatch(query.action, grant.action);
            });