Regular user can't read global realm created by admin


#1

I created a realm on cloud by Realm Studio(3.0.7) in admin account, and according to the doc, it should be readable for every user in default, but neither the realm’s type is full (Full synchronization) nor reference (Query-based synchronization), my regular users logined by ReactNative can not open realm successfully, instead of catch the error described as

“AuthError: The type of the Realm file was invalid.”

I also have tried

user.applyPermissions({userId: ‘*’}, DATABASE_URL, ‘read’)

by admin user in order to force the read permission to a full realm in server side (Node.js), but it turned out to be hang on without any exception.
And I turned my hope to “Fine-grained permissions” of reference realm, upgrade the full realm (by Realm Studio) to reference, then add regular user’s id into __Role class manually, but the result is the same.
I am out of any ideas now, Please give me any kind of help, or a correct process of creating public readable realm. Thank you in advance.


#2

I encounter the same problem. I’d like to know if you solve this.


#3

I think I might found the solution by myself. According the discussions of realm-object-server on github, it seems like the read permission of global realm is not default anymore. After several tries, I finally find out the way to set the read permission to full realm by Realm Studio.

  1. Show system realm (View -> Show system Realms), then you should see a realm of /__admin
  2. Open /__admin, then choose the class named Permission, click “Create Permission” on top-right.
  3. keep the user as null, select the realmFile you want, click True in mayRead, then click “Create”.
  4. Close the /__admin, and click your realm, the User permission at right panel should be public R now.

If your regular user is running on ReactNative App like mine, and had installed debug app when developing, it’s seem like it cached something make Realm.open() hang on, so you should remove the app then install again.

Hope this information will give someone help.