Skip to main content

Security · Row-level security · Governance

What is row-level security? A plain-English guide for BI teams

By DataViz team 4 min read

In short

Row-level security (RLS) is a rule that filters a table's rows by who is reading it, so one dashboard shows each person only their own region, accounts or team. Column-level security does the same for columns, hiding fields such as salary or email from the people who shouldn't see them.

What row-level security means#

Row-level security is a filter that the BI tool adds to every query, chosen by who is asking. A sales manager in Europe and one in North America open the same "Revenue" dashboard; each sees only their own region's rows, and the totals are worked out from those rows alone. Nobody maintains two dashboards, and nobody can see the other region by changing a filter, because the filter isn't theirs to change.

Column-level security (CLS) is the same idea for columns: a rule hides fields such as salary, margin or a customer's email from the people it covers, everywhere those fields could appear.

Why BI teams need it#

Without row rules, teams fall back on one of three workarounds, and each one fails eventually:

WorkaroundWhat goes wrong
A copy of the dashboard per team or regionCopies drift apart; a fix made in one never reaches the others.
A dashboard filter set to "my region"A filter is a convenience, not a boundary: anyone can change it.
A separate database view per audienceEvery new audience is a database change, and BI permissions still decide who opens what.

A rule that the tool applies to the query itself is the only version that holds when someone exports the data, asks an AI assistant about it, or opens the dashboard through a shared link.

How a row rule works#

A rule has three parts: the dataset it protects, who it covers (roles, individual people, or everyone) and the condition a row must meet to be shown.

ConditionEffect
region = 'Europe'The people covered see only European rows.
region IN ('Europe', 'North America') AND channel <> 'Partner'Two regions, without partner sales.
LOWER(account_manager_email) = LOWER(${user.email})Each account manager sees only their own accounts.

The last kind is the most useful: one rule, applied to everyone, that adapts to the person reading. In DataViz the variables are ${user.email}, ${user.id}, ${user.name} and ${user.roles}, each replaced with the reader's own value.

Two details matter more than they look:

  • A missing value is never true. region <> 'HR' also hides rows whose region is empty. Decide whether that's what you want.
  • A rule that can't be applied should show nothing, not everything. If its column is renamed or removed, a safe tool fails closed. DataViz does: such a rule lets no rows through until it is fixed.

Where the rules have to hold#

A row rule is only as good as the path that skips it. Check every way data leaves the tool:

  1. Charts and dashboards, including public links and embeds
  2. Dataset previews, downloads and scheduled reports
  3. AI answers, from the built-in assistant and from AI clients connected over MCP
  4. Raw SQL and notebooks, which read tables directly

The last one is where most tools leak. A person covered by a rule shouldn't be able to open a SQL editor on the same connection and select the rows the rule hides. In DataViz that person can't query a protected connection in SQL Lab or Python Lab at all, unless their role is explicitly given the right to bypass rules for raw access.

Common mistakes#

  • Protecting one dataset but not its siblings. A rule on Orders doesn't cover Monthly revenue by region if that is a second dataset reading the same table. Put the rule on every dataset that reads the table.
  • Testing as yourself. Admins often see everything. Always test as a member the rule covers.
  • Rules for people instead of roles. Per-person rules are hard to review. Apply rules to roles, and use variables for the per-person part.
  • Forgetting the AI. If an assistant can answer questions about the data, it must answer with the asker's rules.

How to set up row-level security in DataViz#

  1. Open RLS & CLS in the sidebar and choose Create Security Policy.
  2. Name the policy after what it does ("Europe team sees Europe only"), keep the type Row-Level Security, and pick the dataset.
  3. Under Applies to, add the roles or members it covers. A new policy covers nobody until you choose.
  4. Write the condition, or build it from a column, an operator and a value.
  5. Under Test as a member, pick someone it covers and choose Show what they'd see.
  6. Set the status from Draft to active and save.

The full reference is in the row and column security guide.

A short checklist#

  • Every dataset that reads a sensitive table has the same rules.
  • Rules are applied to roles; variables handle the per-person part.
  • Each rule was tested as a covered member before it was switched on.
  • Public links and embeds are set to view as a role, not as an admin.
  • Raw SQL access on protected connections is limited to roles that need it.

Questions and answers

Is row-level security the same as permissions?

No. Permissions decide which dashboards, datasets and features a person can open. Row-level security decides which rows of the data they see once they are there, so two people with the same dashboard can see different numbers.

Does row-level security work with AI assistants?

It should, and in DataViz it does: the built-in Insight AI assistant and AI clients connected over MCP answer with the asking person's row and column rules applied, so an assistant never sees a row its user can't.

Can someone bypass row-level security with SQL?

In many tools, yes, if they can open a SQL editor on the same connection. In DataViz a person covered by a rule can't query that connection in SQL Lab or Python Lab at all unless their role is given the right to bypass rules for raw access.

How do I test a row-level security rule?

Test it as a person it covers, not as an admin. In DataViz, open the policy, choose Test as a member, pick someone and choose Show what they'd see, before you switch the rule from Draft to active.

What is column-level security?

Column-level security hides whole columns, such as salary or customer email, from the people a rule covers. In DataViz hidden columns disappear from chart editors, previews, exports and AI answers.