Roles and permissions


#1

Hi, I’m very new to Realm platform
I’m walking through the doc and created some sample realm, but I found that the roles and permissions are not working.

I use .NET C# and when I try the code in this section:
https://docs.realm.io/sync/using-synced-realms/access-control/fine-grained-permissions#roles

// List all roles
var roles = realm.All<PermissionRole>();

I got this exception:
System.ArgumentException: ‘The class PermissionRole is not in the limited set of classes for this realm’

And I don’t see those __Role, __Permission in the Realm Studio (I’ve checked the “show system realms, classes…etc”) like below:
https://docs.realm.io/sync/using-synced-realms/access-control/fine-grained-permissions#how-do-i-prevent-users-from-adding-themselves-to-roles

Am I missing anything?


#2

How are you opening the Realm? If those are missing, it’s probably because you’re using FullSyncConfiguration. You can read up here on how to open a Realm in query based mode.


#3

Thanks, will try that.