Row Level Security based on multiple factors

  • peterg417

    SSC Veteran

    Points: 217

    Hey there, I recently got a request from some people here to implement another level of RLS for a couple of tabular models that I manage.

    Background: I work for a commercial real estate company, so the security that I have implemented is based on region. Someone in Toronto can only view data from Toronto. Someone from Vancouver can only view data from Vancouver. And so on. Basically I used this guide:

    However, a request came in that for Calgary specifically, we should also implement security based on Property Type (Industrial or Office type). So now there should be 2 levels.

    1. Is the person viewing the data in Calgary? If yes, then what Property Type are they associated with? Display the data for their respective property type.
    2. If they are not in Calgary, then proceed as before.

    I'm trying to figure out a simple way of doing this. I'm thinking of creating another column that concatenates Region+Property Type ONLY IF Region = Calgary; otherwise just use Region.

    Any advice would be greatly appreciated. I hope what I wrote out makes sense, and if I need to clarify anything, please let me know.

    • This topic was modified 7 months, 3 weeks ago by  peterg417.
  • Site Owners

    SSC Guru

    Points: 80376

    Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply