Row-level security in reports restricts each query to the rows a viewer is entitled to see, so every manager opens the same report and receives only their own team's figures. It works by mapping each user to a scope, such as a cost centre or region, and enforcing that filter where the data is read.
Key takeaways
- Row-level security must be enforced where data is queried, not only in the report layout.
- Each user needs a clear mapping to the scope they are allowed to see, maintained as the organisation changes.
- Aggregates, exports and shared links can leak rows that the visual filter hides, so each path needs testing.
- A test matrix with one account per manager is the most reliable way to prove the rule works before rollout.
What does row-level security mean for a manager report?
Row-level security means the data source itself decides which records a user receives. The report is one artefact, and the permission is attached to each row through a rule. A sales manager and a regional director can open the same dashboard, yet the numbers differ because the query returns different rows.
This differs from object-level permissions, which decide whether a user can open a report or a table at all. Row-level rules work inside an allowed object. That distinction matters because a manager who can open a shared report may still need to see only one branch.
How do you decide which rows each manager can see?
You decide by defining a scope for each row and a scope for each user, then comparing them. Typical scopes are cost centre, region, business unit or account owner. The mapping table is the most important artefact in the design, because every rule depends on it.
- List the dimensions the business already uses to assign ownership, such as the employee master data or the CRM account owner field.
- Choose one authoritative source for each mapping, and avoid copying it into spreadsheets that drift out of date.
- Decide how managers with several teams are represented, for example one row per user and scope.
- Define what happens to a user with no mapping. The safe default is no rows, not all rows.
- Set a review cadence so that transfers and departures update access within a known window.
Where should the filter live?
The filter should live as close to the data as your architecture allows. Enforcing it in the database or semantic layer means every consumer inherits the rule, while enforcing it only in a dashboard means each new export or connector is a separate risk. The table below compares the common options using qualitative criteria.
| Option | Strength | Where it fails |
|---|---|---|
| Database row policies | Applies to every client and query path | Requires database expertise and careful role design |
| Semantic model rules | Shared across all reports built on the model | Bypassed by users with direct access to the underlying tables |
| Report-level filters | Quick to build and easy to change | Removed or edited by anyone who can modify the report |
| Application-layer checks | Fits custom software with its own permission model | Each new reporting tool must reimplement the check |
In practice, most organisations combine two layers, such as a database policy for the sensitive tables and a semantic model rule for user experience. For how these layers fit into a wider data flow, see our guide on system integration and API engineering. The vendor documentation for database policies explains the exact syntax; the PostgreSQL manual on row security policies is a clear example of how a policy attaches to a table.
When does row-level security fail?
Row-level security fails most often at the edges, not in the main filter. The rule may be correct for the detail table while an aggregate, a cached extract or an export still exposes the other rows. Each path must be checked separately.
Use this checklist before you rely on the rule:
- Direct table access: confirm that analysts and service accounts cannot bypass the policy.
- Aggregates: check that totals computed over hidden rows are not shown, for example as a company-wide average in a manager's view.
- Cached extracts: confirm that a refreshed dataset is filtered per user, not once for everyone.
- Exports and subscriptions: confirm that the recipient's scope applies, not the scope of the person who created the schedule.
- Shared links: confirm that opening a link does not reuse another user's session.
- Joins: confirm that a filtered table joined to an unfiltered one does not reveal hidden keys through counts.
Each item corresponds to a real failure pattern that engineers encounter, and none of them is solved by the report layout alone.
Hypothetical examples
Here are two hypothetical scenarios:
Scenario one. A manufacturer keeps production figures in a warehouse database and shows them in one dashboard. Plant managers should see only their plant. The team enforces the rule in the database and tests a service account, which turns out to have a broad role. The fix is to narrow that role and add a test that fails if the account returns rows outside its scope.
Scenario two. A services firm filters a sales dashboard by account owner in the report. Managers are satisfied until a regional director exports the data to a spreadsheet and shares it, which carries every row. The fix is to move the rule into the semantic model and to restrict export rights for the dataset.
Neither scenario describes a real organisation. They illustrate where the rule usually breaks: in a privileged account and in an export path.
Does row-level security help with GDPR obligations?
Row-level security can support the security of processing that the GDPR requires, because restricting access to personal data to people who need it is a recognised safeguard. The regulation states that controllers and processors must implement appropriate technical and organisational measures, taking the risk into account, as set out in Regulation (EU) 2016/679 on the official EUR-Lex text. This article is general information and not legal or tax advice.
Row-level security is a technical measure, not a compliance programme. It does not decide what lawful basis applies, how long data is kept, or whether a transfer is permitted. Those questions belong to your legal and data protection advisers. For the technical side of access control, our notes on security and GDPR engineering cover logging and least-privilege design. Rui Codex provides technical implementation support, not legal, tax or compliance advice.
How do you test that managers see only their own figures?
You test by running the same report as a representative account for each scope and comparing the returned rows with an independent count from the source. A test that only checks the dashboard visually will miss aggregates and exports. The test should be automated so that it runs after each change to the model or the mapping.
- Create one test account per scope, plus one account with no mapping.
- For each account, record the row count and the total of a key measure through every access path.
- Compare those totals with a query run directly against the source, filtered by the expected scope.
- Confirm that the no-mapping account returns no rows.
- Repeat the test after every change to roles, mappings or report publishing.
Microsoft documents how row-level security is configured and tested in Power BI, including how to use the 'View as' feature to check a role; see row-level security in Power BI. Whatever tool you use, the principle is the same: prove the rule with data, not with the screen. If you want an outside engineering review of your reporting access model, you can request a project consultation, or email info@ruicodex.com to discuss the scope.
Frequently Asked Questions
Is hiding rows in a dashboard enough for row-level security?
No. Hiding rows in a dashboard changes only what that visual displays, while the underlying data can still be reached through exports, direct table access, shared extracts or aggregates. Real row-level security applies the rule where the data is queried, and then each access path must be tested to confirm that it respects the same scope.
Where should row-level security be enforced first?
Enforce it first at the layer that every consumer uses, which is usually the database or a shared semantic model. That way, a new report or connector inherits the rule automatically. Report-level filters can remain as a convenience for users, but they should never be the only control protecting sensitive figures.
What should happen when a user has no mapping?
A user with no mapping should see no rows. A default-deny rule makes the gap visible, because the report looks empty and someone fixes the mapping. Showing all rows to an unmapped user is the failure to avoid, since it silently exposes the full dataset to anyone whose record was missed.
How often should manager access be reviewed?
Review it whenever people join, move or leave, and on a regular schedule that fits your organisation's change rate. Tie the mapping to the authoritative source, such as the HR or CRM ownership field, so that changes flow through rather than being edited by hand. Stale mappings are a common cause of managers seeing figures that no longer belong to them.
Does row-level security replace a data protection review?
No. Row-level security is one technical measure that supports access control, but it does not decide lawful basis, retention or transfers. A data protection review covers those questions, and it should be carried out by your legal and privacy advisers. Technical measures and legal analysis work together rather than substituting for each other.
Sources
- Row Security Policies - PostgreSQL Global Development Group
- Row-level security in Power BI - Microsoft Learn
- Regulation (EU) 2016/679 (General Data Protection Regulation) - Official Journal of the European Union