Warehouse data and dashboards
Set rules on warehouse data with datasets
Publish warehouse tables as datasets with access levels, row rules and column masks, so each person asks only the rows and columns they may see.
On this page
A dataset is a warehouse table or view that people ask through rules you set. You decide who may ask it and how much, which rows each person sees, and which columns are masked for them. Ahamo's AI and every dashboard tile then ask it as the person, under their rules.
Availability. Managing datasets needs a role with Manage datasets. No built-in role has it, so a workspace owner makes one in People › Roles. A dataset needs a warehouse connection that can only read. Rules that use what your company directory says about a person need company sign-in, on the Team plan and up.
The first dataset governs its connection
When you add the first dataset on a connection, the connection becomes governed. From then on, Ahamo's AI reads that connection only through its datasets. Free SQL on it is refused, even with approval, so nobody gets around the rules. Live dashboard tiles with their own SQL don't run on it either.
Deleting a connection's last dataset makes it ungoverned again, and free SQL runs on it again.
Add a dataset
- Open Workspace settings › Datasets and choose Add dataset.
- Pick the Warehouse connection.
- Enter the Table or view, by its full name as the warehouse writes it, such as
my-project.shop.users. - Give it a Name and choose Add.
Ahamo reads the table's columns and their types. A dataset has at most 1,000 columns, and a workspace at most 1,000 datasets.
You can also do it in the chat, for example "Make a dataset of the customers table in BigQuery, where people see only their own country". Each change waits in a card until you choose Approve.
Decide which rows each person sees
Open the dataset and choose Rules. The Row rule says which rows a person sees. Leave it empty for every row.
A rule names the dataset's columns and these facts about the person:
| Write | It is |
|---|---|
person('country') | The person's value of an attribute from the company directory |
person_in_group('Global sales') | True when the person is in that directory group |
person_id() | The person's Ahamo id |
Combine tests with AND, OR, NOT, IN, BETWEEN, IS NULL and comparisons. For example, this rule shows people their own country's rows, and every row to the Global sales group.
country = person('country') OR person_in_group('Global sales')When the directory says nothing about a person, a rule that needs it lets no row through. No rule can turn a missing fact into every row.
Mask columns
Under Column masks, choose Add mask, pick the Column and the Mask:
- First character only shows the first character, as
a***; - Hidden shows nothing;
- Hashed shows a code in place of the value, the same code for the same value.
Unless lifts the mask for the people its condition holds for, such as person_in_group('HR'). Ahamo's AI never guesses or restores a masked value.
Give access
Open Access and choose Give access. Give it to A person, A directory group or Everyone in this workspace, with a role that gives one of these levels:
| Level | What they may do |
|---|---|
| Manage | Change the dataset's rules and masks, and who may use it |
| Rows | Read its rows and ask any question, as the rule and masks allow |
| Metrics only | Ask for totals and groups only, never single rows. Groups of fewer than 5 rows are left out |
Without a level, a person doesn't see the dataset, unless people may find it. On a Rows grant, Export records whether they may also take rows out as a file.
Each level comes from a role with Read dataset rows, Read dataset metrics or Manage datasets. If no role gives the level you need, make one in People › Roles. See Roles and permissions.
Check what a person sees
- See as picks a person and shows their level, the rows their rule lets through, how each column is shown to them, and the query Ahamo sends for them. Nothing runs and no row is read.
- Tests holds sample rows and whether a person with given attributes and groups should see each one. Choose Run tests after you change the rule.
Let people find a dataset
Turn on Anyone in the workspace can find it and add a description. Everyone in the workspace then sees its name and description and can ask for access. They never see its rows, columns or rules until they get a level.
Ask for access to a dataset
People see the datasets shared with them, and the ones they can ask for, in Workspace settings › Datasets.
- Choose Ask for access on the dataset.
- Choose Rows to read its rows, or Metrics only for totals and groups.
- Say why you need it, if you like, and choose Send request.
Ahamo's AI also offers this in the chat when a question needs a dataset you can ask for.
The dataset's managers see the request under Requests. Approve gives the level, with Allow export for Rows. Decline declines it. The person is told either way.
Where the facts about a person come from
Attributes and groups come from your company sign-in. In its settings, Directory details maps each attribute to the claim it is read from, such as country from ctry, and names the groups claim. Each sign-in replaces the values. See Sign in to Ahamo.
What is recorded
Every question asked of a dataset is in the audit log, with the person, the dataset, their level and the query.
Troubleshooting
This connection may change data, and a dataset's statements run without asking. Connect the warehouse again with a role that can only read, then add the dataset.
Managing datasets needs Manage datasets. Ask a workspace owner for a role with it.
No role gives a dataset level yet. Make a role with Read dataset rows, Read dataset metrics or Manage datasets in People › Roles.
No directory details yet for this person, so a rule that needs them lets no row through. The person hasn't signed in with company sign-in since the directory details were set, or the claim is missing. Check Directory details.
A question comes back with only the kind of failure. A governed question never says where or why it failed, so it can't reveal hidden data. Ask a simpler question.