Use case
You manage access through an identity provider (e.g., Okta) where users belong to a base group likeviewer and optionally a regional group like
viewer_north_america. You want the base group to grant member-level access
while regional groups layer on row-level filters that restrict which rows a user
can see.
The challenge: when a user belongs to both groups, Cube combines matching
policies with OR semantics for row-level filters. A base policy with no
row filter is maximally permissive, so it effectively overrides the regional
filter. The user sees all rows instead of only their region.
Data modeling
Consider anorders cube with a country dimension:
The problem
A naive approach assigns member access to the base group and a row filter to the regional group:viewer and viewer_north_america matches both policies. The
viewer policy has no row filter (all rows allowed), and the
viewer_north_america policy filters to North American countries. Because
row-level filters from multiple matching policies combine with OR, the
permissive viewer policy wins and the user sees all rows.
The solution
Add a row-level filter to the base group that matches no rows. This makes the base policy restrictive by default, so it never overrides regional filters:viewer policy now filters country = '__NONE__', a value that doesn’t
exist in the data. On its own, this grants access to zero rows.
When a user belongs to both groups, Cube combines the two row filters with OR:
Adding more regions
Scale this pattern by adding a policy per regional group. The baseviewer
policy continues to act as the member-access gateway while granting no rows on
its own:
viewer + viewer_north_america + viewer_europe sees rows where
country is in US, CA, MX, DE, FR, GB. The dummy __NONE__ filter from the
base group adds nothing to the result.
Result
For a user in bothviewer and viewer_north_america, Cube generates SQL like: