Sub topic 10
Workspace roles that bypass RLS
This chapter assumes you can build a role in Power BI Desktop, write a DAX table filter expression, and publish a semantic model to a workspace. You should also know how to assign members to a role in the service. Here you learn which workspace roles skip RLS entirely, why that happens, and how to design around it.
Why workspace roles matter for RLS
RLS roles are defined on the semantic model. Workspace roles are defined on the workspace that holds it. They are two separate permission systems, and the workspace system can override the model system.
A common failure looks like this. You build a role, test it, and assign your report readers to it. Then a colleague who is a workspace Member opens the report and sees every row. Nothing is wrong with the role. The colleague's workspace role never evaluates it.
The rule: RLS applies only to users who have no write access to the semantic model. Write access is granted through workspace roles and through some item-level permissions.
Which workspace roles bypass RLS
Workspace roles are Admin, Member, Contributor, and Viewer. The first three can edit content in the workspace, which includes editing the semantic model. Viewer cannot.
| Workspace role | Can edit the semantic model | RLS applies |
|---|---|---|
| Admin | Yes | No |
| Member | Yes | No |
| Contributor | Yes | No |
| Viewer | No | Yes, if the user is in a role |
The reasoning is practical. A user who can edit the model can open it, remove the role, or read the data directly. Enforcing RLS on that user would give a false sense of protection, so the service does not enforce it.
A Viewer who is not assigned to any RLS role is a different case, covered below.
Other permissions that count as write access
Workspace roles are not the only route to write access. Check these too:
- Build permission on the semantic model lets a user create new reports on it. Build permission alone does not bypass RLS, but a user who also has Write permission does.
- Write permission on the semantic model, granted directly or through an app or sharing link, bypasses RLS.
- Ownership of the semantic model means the owner has write access. The person who published or took over the model is not filtered.
Read and Build permissions are the ones you give to RLS-restricted consumers. Reshare permission does not bypass RLS, but it lets the user pass the same restricted view to others.
The three Viewer cases
A Viewer's experience depends on role assignment. The same Viewer can see different things in different models.
- The model has no roles. RLS is not in play. The Viewer sees all data, provided they have Read permission.
- The model has roles and the Viewer is assigned to one. The role's filters apply.
- The model has roles and the Viewer is assigned to none. The Viewer cannot see data in reports on that model. Visuals show an error or stay empty.
Case 3 is the safe default. Defining roles on a model makes the model deny by default for Viewers who are not assigned. Note, however, that the model is only safe for readers. Anyone with write access is still outside the system.
Seeing the bypass for yourself
You can detect the bypass with a measure that returns the signed-in identity and a count of visible rows. Add these to the model:
Current User = USERPRINCIPALNAME()Visible Rows = COUNTROWS ( Sales )Publish the model, put both measures on a card visual, and open the report as two different users:
- A workspace Viewer assigned to the West role.
Visible Rowsshows only the West count. - A workspace Member.
Visible Rowsshows the full count, even if that person is also listed in the West role.
The second result is the bypass. The role assignment exists, but it is ignored because the member has write access.
Testing as a bypassed user
Test as role in the service lets you impersonate a role while you are an Admin or Member. This is useful because it shows the filtered view even though your own access is unfiltered. It tests the role definition, not the bypass. Keep these two things apart:
- Test as role answers "does my DAX filter behave correctly?"
- Opening the report as a real Viewer answers "will a real reader be filtered?"
Test as role is not enough on its own. Before release, sign in as a real Viewer, or ask someone who is one, and confirm what they see. A role that works under Test as role can still be bypassed in practice if the person is a Member through a security group.
Group membership can hide a bypass
Workspace roles can be assigned to security groups. A user can also belong to several groups. Suppose:
- The group
Sales-Readersis a Viewer and in the West role. - The group
Sales-Analystsis a Contributor. - Dana belongs to both groups.
Dana has write access through Sales-Analysts. She is not filtered, even though Sales-Readers is a Viewer group in a role. The highest access wins.
This causes real incidents, because nobody grants Dana Contributor directly. It arrives through a group someone else manages. When you audit, expand every group, not only the names on the workspace access list.
Designing around the bypass
You cannot configure RLS to apply to an editor of the same workspace. You can structure your environment so editors and readers are separate people, in separate places.
Separate the authoring workspace from the consumption path
Keep the semantic model in a workspace that only a small group of trusted authors can reach. Give readers access in one of these ways:
- Publish a Power BI app and give readers access to the app. App audiences do not give workspace roles.
- Share reports with Read and Build permissions only.
- Build thin reports in a second workspace where readers are Viewers, connected to the shared semantic model.
Use a dedicated model workspace
A workspace used only for semantic models limits who holds write access. Report authors in other workspaces get Build permission, so they can create reports without being able to edit the model. Build permission does not bypass RLS, so their reports are still filtered for them.
Treat write access as full access
Plan as if every Admin, Member, and Contributor can read the whole model. If some data must never reach them, RLS is the wrong control. Remove the data from the model or place it in a separate model that those people cannot write to.
Audit checklist
Run this list whenever you publish a model that has roles.
- List workspace Admins, Members, and Contributors, and expand every security group in the list.
- Check the semantic model's permissions page for users with Write access.
- Confirm the model owner, and who can take over ownership.
- Confirm that every reader is a Viewer, an app user, or a Read/Build user.
- Confirm that every reader is assigned to a role, directly or through a group.
- Sign in as a real Viewer and check that the card with
Current UserandVisible Rowsmatches their role.
Common mistakes
| Symptom | Likely cause | Fix |
|---|---|---|
| A tester sees all rows | The tester is an Admin, Member, or Contributor | Test with a Viewer account, or use Test as role |
| A reader sees all rows after being promoted | The new workspace role has write access | Demote to Viewer, or move access to an app |
| A reader sees all rows although they are only a Viewer | The reader has Write permission on the model, or belongs to a group that does | Remove Write permission and check group membership |
| A new Viewer sees an empty report | The Viewer is assigned to no role | Add the user or their group to a role |
| A role works in Desktop and fails in the service | Desktop View as does not reflect workspace roles | Verify in the service as a Viewer |
Exercises
Exercise
A semantic model has a role named West with the filter [Region] = "West". Priya is a workspace Contributor and is also listed as a member of the West role. She opens a report and sees sales for all regions. Is the role broken? Explain.
Show answer
No. Contributor has write access to the semantic model, so RLS is not applied to her. Her role assignment is stored but ignored. To filter her, she must have only Viewer access, or Read and Build permission without Write.
Exercise
A Viewer opens a report built on a model that has two roles, and the Viewer is assigned to neither. What do they see, and why is this useful?
Show answer
They see no data, because the model has roles and the Viewer matches none of them. This is useful because it denies access by default: a reader added to the workspace by mistake does not see unfiltered data.
Exercise
Dana is in a Viewer security group assigned to the West role, and also in a separate security group that has the Contributor workspace role. Is she filtered? How would you find the cause if she reported seeing all regions?
Show answer
She is not filtered, because the Contributor role gives her write access, and the highest access wins. To find the cause, expand each security group listed on the workspace access page and check whether Dana is a member of one with Admin, Member, or Contributor.