Requirement
Allow users of an organisation to view all rows where their organisation is involved, where involvement is specified by the org name in one of three columns
Current RLS table
UserName, original_organisation, partner_organisation, active_organisation, customer
test user, test_company, test_company, test_company, ββ
Issue: Unable to see any data as the organisation is never the same for all 3 values
Is there a way to change the RLS so that any column condition matching is sufficient per row?
Is there a way to look for the column value in a list of values stored in a column?
(I could add a calculated value with a list of involved organisations)
Hello @Ted, I just want to confirm that I understand the data that is being returned in the dataset you are applying this to. Are you saying that values in a row for a single ID will never contain the value for the original_org, partner_org, and active_org, all at once? If that is the case, are the remaining columns returning a null value?
With that information, my first thought is you should return 3 rows per UserName. In each row return a value for 1 of the 3 columns and set up your RLS that way to ensure it isnβt directly looking for all 3 of them to match on a single row. I think that would bypass the issue you are currently facing.
Alternatively, it may be worth considering updating your dataset to return all 3 values in each row to simplify the RLS process and improve filtering capabilities on the dashboard. I hope this helps!