RLS in Superset

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up rls in superset by linking filter clauses to user roles and tables. When a user views a chart, the app adds those filters to the query. Data teams often build one shared dashboard for many regions or business units. Without row filters, broad roles let every viewer read all rows in the table. That broad access exposes sensitive records across teams that should stay separate. How rls in superset works under the hood Row level security in this tool works by rewriting queries before t

Just-in-Time Access: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up rls in superset by linking filter clauses to user roles and tables. When a user views a chart, the app adds those filters to the query. Data teams often build one shared dashboard for many regions or business units. Without row filters, broad roles let every viewer read all rows in the table. That broad access exposes sensitive records across teams that should stay separate.

How rls in superset works under the hood

Row level security in this tool works by rewriting queries before they run. An admin creates a filter rule and picks one or more target tables. Next, the admin links that rule to a specific group or user role. The rule holds a filter clause that checks a column against a value.

The app supports two main ways to apply these row filters to roles. Regular rules add a filter only for users who hold the assigned role. Base rules block all rows by default until a role grants specific access. Teams combine both types to lock down core tables and open select slices.

When a user loads a dashboard, the app checks their assigned roles first. It finds every row filter that matches both the user and the dataset by default. Then the app injects those conditions into the outer query for the chart. The database runs the filtered query and returns only the allowed row subset.

What native row filters solve and where gaps remain

Native row filters stop dashboard viewers from seeing data outside their assigned region. You do not need to clone the same chart ten times for ten teams. One shared dataset serves everyone while each user sees only their own slice. This keeps dashboard upkeep simple for data analysts and report builders.

Still, app level filters only govern charts built inside the reporting tool itself. The reporting app often talks to the database using one shared service account. That single database account must hold broad read rights across all table rows. If a user gets SQL editor access, they might bypass dataset level rules.

Just-in-Time Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Also, engineers and analysts often query the same database from local SQL tools. App filters do not follow users when they leave the dashboard web app. The database only sees who logs in, not what each query touches in flight. Sensitive columns like emails, phone numbers, or card numbers still return in plain text. A strong setup needs controls that inspect queries and mask fields at runtime.

Managing role drift across growing data teams

As teams add more tables, keeping filter rules in sync gets much harder. Every new table needs its own filter mapping before you add it to charts. If an analyst forgets one mapping, the new chart leaks all table rows. Admins must audit role assignments and table rules on a regular schedule.

Testing rules also takes care because admins hold broad rights by default. An admin must test dashboards with a limited test user to verify filters. Checking query logs helps confirm that the right filter clauses run every time. Clear naming habits for roles and rules reduce mistakes during daily updates.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Does rls in superset protect queries in the SQL editor?

Dataset row filters apply to charts and dashboards, not always raw SQL queries. If users have direct SQL editor rights, they can often query underlying tables directly. You must restrict SQL editor permissions or enforce controls at the database layer.

What happens when two row filter rules apply to one user?

When a user holds multiple roles with rules on the same table, filters combine. Rules with the same group key join together so the user sees both slices. Rules without a shared group key narrow the results to rows matching both conditions.

Can native row filters mask sensitive columns like emails or phone numbers?

No, row level rules only hide or show entire rows based on a condition. They do not rewrite column values like emails, phone numbers, or national IDs. To rewrite matched fields in query results, you need dynamic data masking controls.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.