Skip to content

Commit

Permalink
typefix
Browse files Browse the repository at this point in the history
  • Loading branch information
vasilev-alex committed Jan 14, 2025
1 parent d92209f commit c4391b0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/cubejs-api-gateway/src/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,6 @@ class ApiGateway {
const compilerApi = await this.getCompilerApi(context);

const queryNormalizationResult: Array<{
query: Query,
normalizedQuery: NormalizedQuery,
hasExpressionsInQuery: boolean
}> = queries.map((currentQuery) => {
Expand All @@ -1200,22 +1199,20 @@ class ApiGateway {
}

return {
query: currentQuery,
normalizedQuery: (normalizeQuery(currentQuery, persistent)),
hasExpressionsInQuery
};
});

let normalizedQueries: NormalizedQuery[] = await Promise.all(
queryNormalizationResult.map(
async ({ query: currentQuery, normalizedQuery, hasExpressionsInQuery }) => {
let evaluatedQuery = currentQuery;
async ({ normalizedQuery, hasExpressionsInQuery }) => {
let evaluatedQuery: Query | NormalizedQuery = normalizedQuery;

if (hasExpressionsInQuery) {
// We need to parse/eval all member expressions early as applyRowLevelSecurity
// needs to access the full SQL query in order to evaluate rules
evaluatedQuery =
this.evalMemberExpressionsInQuery(normalizedQuery);
evaluatedQuery = this.evalMemberExpressionsInQuery(normalizedQuery);
}

// First apply cube/view level security policies
Expand Down

0 comments on commit c4391b0

Please sign in to comment.