Multiple instance access of a user to data in RLS dataste

Hallo all,

I have the following question:
Currently, I have a number of datasets that I share with our customers. These datasets include data from all customers and to prevent them to view others’ data I use RLS. I attach the RLS file below (namespace etc. are random). You can see that I have multiple namespaces. Each namespace corresponds to a unique customer and some namespaces might have multiple users. Finally, each namespace corresponds to a unique operatorid value, the column that is included in the shared datasets.

Now, a customer request is to allow the users of a namespace to view the data of other namespaces besides their own. That’s because there might be 4 different companies and namespaces, but one is the parent company and the other 3 are the child companies. Then the parent must be enabled to view data from all 4 companies while the 3 child companies must only view their own data. That means that the parent company must have access to multiple values of operatorids.

How can I achieve that?

Hi @Fotis_flex

The OperatorId column I suppose is the one that controls Row-Level security. You can have a comma separate list of operatorids for the case where you want to provide access to multiple companies.

Regards,
Giri

1 Like

perfect, I will test this!

1 Like

Hallo @Giridhar.Prabhu

Thanks for the solution! Just a clarification. Is there any limitation to the number of elements in the comma seperated list of operatorids? Can I have as many as I want for e.g?

Hi @Fotis_flex

There are two things. You need to work within these limits.

a. Max length of the String column which appears to be 2047 characters.
b. The max list of that can be applied in row level security which appears to be quite large ( 192,000 members)

Regards,
Giri