We have a RLS permissions dataset that we apply to other datasets. It supports a multi-tenant model where we can limit a user’s access to a segment of our data.
Our main dataset has 2 columns in it: Account and Building. We create a GroupName that matches the Account and put all the users in the Account in that GroupName. Our RLS permissions dataset then has one row like:
GroupName,UserName,Account,Building
abc,,abc,
That works as we expect: all users in Account ‘abc’ can see all Buildings in the Account.
If a user should have access to only a subset of Buildings in the Account, we create a second RLS row:
GroupName,UserName,Account,Building
abc,,abc,
,the-role-name/userX,,"123,456"
which formerly worked as we expected. The userX user in Account abc could see only buildings 123 and 456.
The QS docs state there is a limit of 999 rules per user, so in this example the userX user would have 2 rules (rows) that apply to them, if I am reading the docs correctly.
Our RLS permissions dataset has a total of 1400+ rows in it now, a combination of GroupName and UserName rows, and the Building + UserName rows seem to be getting ignored. In this example userX can see all the Building rows in the abc Account.
The FAQ docs suggests that this behavior might be because we have exceeded the 999 rule limit.
My question is: how is the 999 rule counting applied? I assume it’s not the total number of rows in the RLS permissions dataset, but the number of rows that apply to a user. So not 1400 but 2 (in this example, one row for the GroupName match and one row for the UserName match).
Am I reading the docs correctly?