Skip to main content

property Tables.restrictions : MutableMapping[str, DatabaseRestrictionCondition]

Mapping from role to corresponding restriction. Restrictions limit the data accessible to users based on their roles. Restrictions apply on table columns and are inherited by all hierarchies based on these columns.
  • Restrictions on different columns/hierarchies are intersected.
  • Restrictions on the same column/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 table:
And from the cube:
Assigning a role to Rose to limit her access to France only:
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: