Skip to content

Commit c77fe3b

Browse files
committed
fix: ignore Data Access Policy-defined visibility in dev-mode and
playground
1 parent 540fabe commit c77fe3b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/cubejs-server-core/src/core/CompilerApi.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import crypto from 'crypto';
22
import R from 'ramda';
3+
import { getEnv } from '@cubejs-backend/shared';
34
import { createQuery, compile, queryClass, PreAggregations, QueryFactory } from '@cubejs-backend/schema-compiler';
45
import { v4 as uuidv4 } from 'uuid';
56
import { NativeInstance } from '@cubejs-backend/native';
@@ -468,11 +469,14 @@ export class CompilerApi {
468469
}
469470

470471
const visibilityFilterForCube = (cube) => {
472+
const isDevMode = getEnv('devMode');
471473
const evaluatedCube = cubeEvaluator.cubeFromPath(cube.config.name);
472474
if (!cubeEvaluator.isRbacEnabledForCube(evaluatedCube)) {
473-
return (item) => item.isVisible;
475+
return (item) => isDevMode || context.signedWithPlaygroundAuthSecret || item.isVisible;
474476
}
475-
return (item) => (item.isVisible && isMemberVisibleInContext[item.name] || false);
477+
return (item) => (
478+
(isDevMode || context.signedWithPlaygroundAuthSecret || item.isVisible) &&
479+
isMemberVisibleInContext[item.name] || false);
476480
};
477481

478482
return cubes

0 commit comments

Comments
 (0)