We have a dataset file with the following values
category_id, value
1, Test1
2, Test2
1, Test3
3, Test4
We have RLS file defined with the following
username, category_id
user1,1
user2,2
This is working perfectly fine and the data is restricted based on RLS
This is integrated into our application as an embedded URL which is generated by calling the generate_embed_url_for_registered_user.
Now we are planning to implement the following
Say an user 3 onboards into our platform and based on his eligibility / preference the categories that he can view is determined in the platform. Now the ask is that we need to update the RLS file dynamically.
We are using Ruby on Rails and use Ruby’s SDK to generate the embedded URL based on the logged in user. Is there any way to automate the following in Ruby on rails once the user onboards in our platform.
- fetch the RLS file (csv & user based) for the dataset used by the dashboard
- update the RLS file with the new user Id & category Id
- publish the RLS file
- Associate the RLS against the dataset