Skip to main content

property Cube.restrictions : MutableMapping[str, MembershipCondition[LevelIdentifier, ‘IN’, bool | int | float | date | datetime | time | str] | RelationalCondition[LevelIdentifier, ‘EQ’, bool | int | float | date | datetime | time | str] | LogicalCondition[MembershipCondition[LevelIdentifier, ‘IN’, bool | int | float | date | datetime | time | str] | RelationalCondition[LevelIdentifier, ‘EQ’, bool | int | float | date | datetime | time | str], ‘AND’]]

Mapping from role to the corresponding restriction. Restrictions limit the data accessible to users based on their roles.
  • Restrictions on different hierarchies are intersected.
  • Restrictions on the same hierarchy are unioned.

Example

Adding a user to the session:
ROLE_USER has no restrictions so all the countries and currencies are accessible from the cube:
Assigning a role to Rose to limit her access to France only:
Unlike atoti.tables.Tables.restrictions, cube restrictions have no impact on tables:
Adding Lena with ROLE_GERMANY limiting her access to Germany only:
Assigning ROLE_GERMANY to Rose lets her access the union of the restricted countries:
Restrictions can include multiple elements:
Since Country and Continent are part of the same Geography hierarchy, restrictions on these two levels are unioned:
Currency is part of a different hierarchy so restrictions on it are intersected with the ones from Geography:
Removing the ROLE_FRANCE and ROLE_GERMANY roles leaves no remaining accessible countries:
A QuerySession has cubes but no tables so there is nothing to merge cube restrictions with. However, data cubes have their restrictions merged with the ones from the session’s tables: