Eduard Lebedyuk · Dec 15, 2016

Is there a way to determine row level security in runtime?

So, I played with row level security and was unable to find a way to get to work it dynamically. I want to determine if the user can access the row in runtime based on a state of external system, but it seems that row level access is calculated during INSERT/UPDATE and stored in %RLI index. Is there a way to achieve runtime access calculation?

I understand that in that case all rows would have to be scanned, and that's a big hit performance-wise.


UPDATE: Answer.

0 293
Discussion (1)1
Log in or sign up to continue

How about if you add a class method ICanSeeThisRecordNow() that returns TRUE or FALSE (based on your external criteria), and a calculated property/column ICanSeeIt that returns this value via SqlComputeCode. Then create a view as:

SELECT whateverColumns FROM myTable WHERE ICanSeeIt=TRUE