QuackUIInstall

Row security

Limit which rows of a model each group can see.

Open a model as an admin and choose Row security on the ribbon.

The Row security editor

Set it up

  1. Decide the dimension that separates people, such as Region.

  2. Create a group for each set of rows and add its members. If each person has their own rows, use user attributes and one group.

  3. For each group, add a rule: unrestricted, or conditions such as Region is Scotland.

  4. Deal with any warnings, then turn it on.

  5. Use Preview as user on a few people.

    Preview as user

How rules combine

  • Within a rule, every condition must match.
  • Between a person’s groups, any rule may match.
  • No rule means no rows.
  • Admins aren’t limited.
  • Empty values never match.

A rule takes up to 10 conditions of up to 1,000 values. There are no exclusions or ranges.

User attributes

A condition can compare a dimension with a fact about the person instead of with fixed values, such as Region is the user’s Sales region. One rule, on Everyone if you like, then gives each person their own rows.

  1. Open File › Attributes and choose New attribute. Give it a name and a kind: text, whole number, date, or true or false. The kind can’t be changed later.

    File › Attributes: Sales region, set by admins, and Cost centre, from a single sign-on claim
  2. Choose where its values come from: admins, or a single sign-on claim.

  3. For values set by admins, select each person in File › Users and choose Edit beside the attribute. Put one value on each line.

    File › Users with Morag Campbell selected and their attributes on the right
  4. In the rule, set a condition’s Is one of to User attribute and pick it. Only attributes of the dimension’s kind are offered.

    A row rule whose condition is Region is one of the user's Sales region
  • Someone without a value of every attribute in a rule gets no rows from that rule. Their other rules still apply. Preview as user names the attributes that are missing.
  • A person has up to 1,000 values of each attribute. A text value is at most 1,000 characters, and a whole number at most 9,007,199,254,740,991 either side of zero. Use text for longer ids.
  • Text is compared exactly. Spaces at the ends of a value count only inside double quotes.
  • A condition has fixed values or an attribute, never both.
  • Attributes can be renamed at any time. One that a rule uses can’t be deleted.
  • Only admins see attributes and their values.

New values apply from the next request, to cached results too.

What people see

Finance sees all stores
Finance: unrestricted.
The Scotland manager sees two
Scotland: their own stores, and a notice.

Refused rather than guessed

A query that reads a fact with no join to a rule’s dimension is refused with row_security_unreachable. If your stock table has no link to Region, people limited by region can’t query it. The editor warns you about such facts.

A list of values that isn’t connected to the rule, such as all product categories, is refused too. Mark the table open reference data to allow it. Measures are filtered regardless.

Overlapping models

Security applies to the model. Another model over the same table, usable by any group and not secured, would give the rows away. QuackUI finds these, names the tables and asks you to acknowledge them. It can’t spot a copy of the data in another file.

Runs, schedules and statistics

Runs are shown to people whose row and column access equals the run’s. Changing rules hides earlier runs’ data from everyone but admins. A change of someone’s groups or attribute values that changes the conditions applied to them hides it from them, until the earlier conditions are back. Row counts and column statistics of secured tables are hidden from non-admins.

Limits of it

Row security doesn’t limit columns. For that, use column security. Admins and anyone who can read the source files see everything. Totals over allowed rows can still hint at things.