4

If say, I have a mobile app that comprises of some private data, and some shared data for a user. How do I set up the realm sync URL so that the shared data is sync across other users while the private data is only synced across devices for that particular user? I noticed in the sample you only setup with one sync URL, what I do not understand is how would other users see the changes? And what if there are realm objects that I do not wish to share with other users?

EpicPandaForce
  • 79,669
  • 27
  • 256
  • 428
dickyj
  • 1,830
  • 1
  • 24
  • 41
  • I saw this post and I believe it sort of answered the question: http://stackoverflow.com/questions/39756637/share-realm-between-different-users-on-realm-object-server – dickyj Sep 30 '16 at 11:41

1 Answers1

2

The Realm Object Server supports access control on Realms, such that users can be given the following permissions for a given Realm:

  • Read
  • Write
  • Manage (meaning the user can grant or revoke permissions on the Realm)

By default users can create new Realms within their unique path: /~/newRealm(~ is resolved to the user ID). The user which created the Realm then has Read/Write/Manage permissions. This user can then grant permissions to other users to this same Realm, and then both users would be syncing data in the shared Realm.

Currently, the APIs to adjust permissions have not been released but will be available in the coming weeks during the beta period.

Adam Fish
  • 1,543
  • 9
  • 11
  • @Adam Fish, API seems to be released, can you please adjust your answer to include more details? I tried both `PermissionChange` and `PermissionOffer` techniques and still can't share realms – ReDetection Feb 25 '17 at 07:21
  • Ok, I was able to share realm using Realm Browser: connect to object server with admin account, add permission record in the `__admin` realm, as @Marius mentioned [in this answer](http://stackoverflow.com/a/39766673/2105993) – ReDetection Feb 25 '17 at 07:30
  • Is `newRealm` required or you can name if whatever you want? – Iulian Onofrei Jan 14 '18 at 16:51