How to get current user's role?

I am trying to apply a read only role for anonymous users like this:

 {
   "identities": [
     {
       "providerType": "anonymous"
     }
   ]
 }

But it doesn’t seem to work, I am still able to write anything so I want to ascertain that the role applied to the user, but how can I do that?

Also, if the role is applied, will it work for the offline database as well as for the synced version of it?

I am using the latest .NET implementation, thank you

This is mostly an atlas question. What you’re looking for is setting sync permission. Have you tried already setting those? If yes, then we need to see those in order to help you.