8

Is there currently a way to allow multiple users to access the same Realm?

Right now the only way I could find is to use an 'app account' instead of an user account, as proposed in another question.

thanks!

Community
  • 1
  • 1
Diogo Andre
  • 658
  • 5
  • 17

1 Answers1

6

In general, you can connect to a Realm file at a virtual path. They must be always absolute, so begin with a leading slash / and never carry a file suffix. Realms at a file name with two leading underscores are considered internal state of the Realm Object Server and have special meaning.

If a path is prefixed by /~/ (like the home directory), the ~ will be expanded by the ID of the user, who is exclusively privileged to create, read and write to Realm files placed within this virtual directory.

If there is no such prefix (e.g. /global), then this is a global Realm. Global Realms may only be created by admin users, but are by default readable by everyone.

Unfortunately we don't offer a direct client-side API yet to manage permissions. But you can access the admin realm living at /__admin with the browser and find the permissions for the given file. Permission where the user is set are specific to this user. The Permission where no user is set are the default permissions. They apply for all users who don't have specific permissions configured. The owner has full access by default by an explicit Permission entry.

marius
  • 7,766
  • 18
  • 30
  • How can I open the ´/__admin´ realm with the browser? "Open Realm URL" doesn't seem to work for me (the "Open" button is always grayed out) and "Connect to Object Server" doesn't show the admin realm. – mbuchetics Sep 29 '16 at 13:46
  • Ok, figured it out myself. The URL needs to be something like "realm://127.0.0.1:9080/__admin". – mbuchetics Sep 29 '16 at 13:55
  • So once this shared realm is set up, if you edit it with the Realm Browser, will it automatically trigger a sync on all users' devices? – Clifton Labrum Dec 09 '16 at 16:54
  • @CliftonLabrum: Yes, the changes will propagate immediately to all devices which are running the app and have opened a local copy of the synced Realm. – marius Dec 10 '16 at 10:46
  • How can I create a subpath ? For example I want to create realm in /global/some_realm ? Thanks. – myexec Jan 29 '17 at 16:10
  • @myexec: These paths are virtual and primarily exist as help to keep things organized. You only need to open a Realm with an admin user at this path and you're done. – marius Jan 30 '17 at 16:19
  • I have been shared a realm by a user. But i am unable to see the data added by the user. What should be the url to access the user's data? – suku Dec 15 '17 at 13:34