1

I have recently been exploring the concept of Row Level Security in my application. At current, I can implement a very basic version of it on my SQL database. I have run a couple of SQL statements to create basic predicates and apply them to tables. I have also created SQL Users as per the examples I have seen online.

To take this further, I would like to integrate this with my MVC Entity Framework application but have hit a few issues.

Using SQL Server Management Studio, to test my row level security, I have to start all my sql queries with "EXECUTE AS USER = ...." and end my queries with "REVERT".

My question here is how this is accomplished via C# ? I had all my LINQ queries performing as expected but now I want them to be filtered using Row Level Security.

Any help is appreciated.

Thanks

Gilmo
  • 89
  • 1
  • 6
  • Connect as the target user to begin with? Tell the IIS to [impersonate the user](https://stackoverflow.com/q/1909114/11683)? – GSerg Apr 22 '19 at 12:00
  • **SQL** is a query language - used by most relational database systems. This doesn't tell us what **concrete** RBMS you're using - please add a relevant tag for this – marc_s Apr 22 '19 at 13:38
  • I thought sql server was implied when I mentioned SSMS. Apologies – Gilmo Apr 22 '19 at 17:37

0 Answers0