Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dgosbell committed Jul 24, 2023
2 parents 53771c2 + a98d2ab commit 9b3cdd5
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
Binary file added docs/features/benchmark-rls-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/features/benchmark-rls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/features/view-as-dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions docs/features/view-as.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: View As
---

The **View As** option can be found in the **Advanced** tab and enables easy testing of RLS roles
![](viewas-button.png)

This enables for both testing the functionality of the selected role to make sure queries return the correctly filtered data and you can run Server Timings traces to measure the impact of these roles on your queries.

The **View As** dialog will show a list of the roles in your model and you can choose which one to test

![](./view-as-dialog.png)

:::info
If you are testing a role with dynamic security. (ie. one that references the USERNAME() or USERPRINCIPALNAME() functions) then you need to tick the role you want to test _and_ tick the **Other User** option to impersonate a different user
:::


When it is active the **View As** option shows a yellow information bar at the top of the query editor. You can exit out of the **View As** mode by clicking on the X in the right hand side of the information bar

![](./viewas-results.png)

# Benchmarking RLS Roles

To make performance comparisons even easier a new option has been added to the Benchmark feature which is enabled when you start the benchmark while you have **View As** active.

![](benchmark-rls.png)

When you tick the option to do a second pass the benchmark results will include a second set of columns in the results for those passes where the RLS role was active

![](benchmark-rls-results.png)

Binary file added docs/features/viewas-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/features/viewas-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9b3cdd5

Please sign in to comment.