Hello,
I am building a Realm app and I am wondering if there is a way to grant read-only permissions to anonymously authenticated users, but read & insert permissions to email/password users without any additional data on the document in question?
Hello,
I am building a Realm app and I am wondering if there is a way to grant read-only permissions to anonymously authenticated users, but read & insert permissions to email/password users without any additional data on the document in question?
Yes - you can add this logic to your ‘Apply When’ when configuring Roles. One way to do it is:
Add a Anon Role and add the following ‘Apply When’ expression (since anon users don’t have an email associated with them).
{
“%%user.data.email”: { “%exists”: false }
}
Grant Read only permissions to this Role
Add an Email Password Role and add the following apply when expression
{
“%%user.data.email”: { “%exists”: true }
}
Grant Read and Write permissions to this Role
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.