Row-Level Security (RLS)
Row-level security (RLS) is a database and BI feature that filters which rows of a table each user can read or change, based on rules tied to who that user is, so many people can share one table while each sees only their own slice.
What is row-level security?
RLS moves the rule for who sees what out of application code and into the data layer, where every query has to pass it. Normal table permissions are all or nothing: a user can read a table or cannot. RLS adds a filter on each row. A policy says, for example, that a sales rep sees only rows where the owner is that rep.
The database applies the filter to every query, whether it comes from an app, a BI tool or a direct SQL session. Common uses are a regional manager who sees only her region, and a SaaS product where each customer sees only its own records in a shared multi-tenant database.
RLS hides rows, not columns. To hide fields such as salary, use column permissions or data masking.
How does row-level security work in Postgres and BI tools?
You switch RLS on for a table, then write policies that return true or false for each row. In PostgreSQL, the documented example is ALTER TABLE accounts ENABLE ROW LEVEL SECURITY, followed by CREATE POLICY account_managers ON accounts TO managers USING (manager = current_user).
Default deny: if RLS is on and no policy exists, no rows are visible or can be changed.
USING and WITH CHECK: USING decides which existing rows a command can see; WITH CHECK decides which new or updated rows are allowed.
Who bypasses it: superusers and roles with BYPASSRLS always bypass RLS. Table owners normally bypass it too, unless the table is set to FORCE ROW LEVEL SECURITY.
Supabase: its RLS guide uses auth.uid(), the ID of the user making the request, inside policies, and says to enable RLS on every table in an exposed schema.
Power BI: roles use DAX filters such as [UserEmail] = USERPRINCIPALNAME(). RLS applies only to workspace Viewers, not to Admin, Member or Contributor roles.
Snowflake: the same idea is called row access policies.
What does row-level security look like in practice?
The usual pattern is one mapping table that links users to the rows they may see, and one rule that reads it. Picture a 200-person distributor with sales data for five regions in one warehouse and a Power BI report on top.
The data team creates a user_regions table. Each row pairs a sign-in email with a region.
In Power BI, one role filters user_regions with [Email] = USERPRINCIPALNAME(), and the model relationship passes that filter to the sales table.
Region managers are added to the role and get the Viewer role in the workspace.
Before launch, the team uses Test as role to check what a manager sees.
Say a manager moves from North to West. The team edits one row in user_regions. No report changes.
What are the pitfalls of row-level security?
Most RLS failures come from people or paths that skip the policy, not from the policy itself.
Admin bypass: owners, superusers and, in Power BI, workspace editors see everything. Test with a real low-privilege account.
Forgotten tables: Supabase warns that a table in an exposed schema without RLS "is readable and writable by any role with a grant on it."
Copies and extracts: data exported or cached outside the secured table no longer carries the policy.
Silent empty reports: a user missing from the mapping table sees no data, which looks like a bug.
Speed: the policy adds a filter to every query, so index the columns it uses.
RLS is one control, not a full security model. It works alongside sign-in, network rules and data governance.
How is row-level security different from role-based access control?
Role-based access control decides which tables and actions a role may use; RLS decides which rows inside a table that role may see. The two stack. Role-based access grants read access to the orders table, and RLS narrows the result to the user's own orders.
Column and object permissions hide whole fields. Microsoft's Power BI docs say RLS cannot limit columns and point to object-level security for that. Filtering only in app code is fragile, because every new query, export or tool needs the same filter again.
Common tools are PostgreSQL and Supabase policies, Snowflake row access policies, and Power BI roles. RLS is a core part of data security in shared analytics and self-service analytics.
Row-level security vs role-based access control
Row-level security | Role-based access control | |
|---|---|---|
Controls | Which rows a user sees in a table | Which tables and actions a role can use |
Granularity | Single rows | Objects such as tables, schemas or reports |
Typical rule | Region equals the user's region | Analysts can read the sales schema |
Where enforced | Database or BI model, on every query | Database, app or identity provider |
Best for | Shared tables with many audiences | Separating duties and environments |
How does Vizio AI approach row-level security?
Vizio AI's closest published work is a dashboard with separate views for different roles; the case study does not say whether those views use RLS. For a global media and entertainment company, DX Studio built a Power BI cybersecurity awareness dashboard with role-based views for executives, security analysts and department heads.
Department leaders could see awareness performance within their own teams. The case study lists "Reduced manual reporting time by 45%". Where to start: write down each audience and the rows it may see, as a simple table, before you write any policy.