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.

Vote up!
Vote down!

Rating: 0

1 answer

Answer

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

Vote up!
Vote down!

Rating: 0

Log in to answer