Skip to main content
getter Cube.restrictions: MutableMapping[str, HierarchyMembershipCondition[Literal[‘IN’], bool | int | float | date | datetime | time | str] | MembershipCondition[LevelIdentifier, Literal[‘IN’], bool | int | float | date | datetime | time | str] | RelationalCondition[LevelIdentifier, Literal[‘EQ’], bool | int | float | date | datetime | time | str] | LogicalCondition[HierarchyMembershipCondition[Literal[‘IN’], bool | int | float | date | datetime | time | str] | MembershipCondition[LevelIdentifier, Literal[‘IN’], bool | int | float | date | datetime | time | str] | RelationalCondition[LevelIdentifier, Literal[‘EQ’], bool | int | float | date | datetime | time | str], Literal[‘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.
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:
Added in version 6.2.1: A restriction can also be defined on a whole hierarchy with atoti.Hierarchy.isin(), granting one member path per branch. Unlike a restriction on a level, this grants members located at different depths:
Adding Iris with that role only, so that no other restriction is unioned with it:
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: