There seems to be some relatively new issue with contextual security roles. This is a new issue and this previously worked fine.
Steps to reproduce:
Create a new security role and select the âContextual roleâ option
Populate the expression with â has(resource, ârecordIDâ)
Verify with a logged in user, non-admin, they can see all records
Update the newly created security role with the expression â resource.recordID == 213
â This example uses a recordID of 213 but choose a recordID that exists for some module in your Corteza instance.
As a non-admin user, Navigate to whatever module has a record with that particular recordID and verify it is not visible.
Expressions that work:
resource.moduleID == someModuleID
any expression that checks for the existence of a field
Expressions that do not work:
Anything that involves reading the value of either the recordID or any field under values, like resource.values.SomeField == xyz
Version: 2023.3.7
Seems to be broken on 2023.3.6 as well.
I tested the .6 and it was broken there but it worked relatively recently because weâve been using this and permissions is a critical thing so we would have noticed if it was âbrokenâ for much longer than that.
We upgraded to .6 and then .7 relatively quickly from 2023.3.5 and I would guess it worked on .5 but I donât know that definitively.
Hmm⊠seems like it works fine for me on c7c6df169 one commit after 2023.3.8 (that commit shouldnât do anything; some meta stuff).
Can you double-check that the permissions are ok for all the roles? Perhaps something is off there. Alternatively if you two ( @jfortun@daniel_charp ) could note down the instructions for me in a bit more detailed fashion; thatâd be best.
It may or may not matter but do you have the ability to test on 2023.3.7 and not .8 since .8 isnât released.
Not much for us to misconfigure.
The contextual expression resource.recordID == 213 does not result in the user seeing the appropriate record but resource.moduleID == someModuleID does result in the user seeing those records, so the user has permissions to the records themselves.