3

我正在试用 Realm 移动平台以确定它是否适合即将到来的项目。

我正在使用服务器管理员用户登录到我的示例应用程序,并通过在SyncConfiguration对象中提供不同的路径,我能够在本地和对象服务器中创建不同的领域。

    String realmUrl = String.format("realm://%1$s:%2$s/my_realm_name", OBJECT_SERVER_IP, BASE_PORT);
    SyncConfiguration syncConfiguration = new SyncConfiguration.Builder(SyncUser.currentUser(), realmUrl).build();
    Realm realm = Realm.getInstance(syncConfiguration);

问题是当我访问 Web 仪表板时,管理员似乎不拥有他使用客户端应用程序创建的领域。
所以我的问题是:用户创建 N 个拥有的领域的最佳方式是什么,这些领域可以通过管理访问权限共享给其他用户?

4

1 回答 1

2

When Realm files are opened for the first time, the SDK will make a request for an access token to the authentication service of the Realm Object Server. This will look up whether a file at this path already exists and create it if not. Files created there will be only owned if they are in the current user's scope. The easiest way to achieve this would be if the users create the files on their own.

as user ID "userA":
  /~/my_realm_name     => /userA/my_realm_name => owned
  /userA/my_realm_name => /userA/my_realm_name => owned
  /userB/my_realm_name => fails (no permissions)
  /my_realm_name       => fails (no permissions)

as user ID "admin" with administrator privileges:
  /~/my_realm_name     => /admin/my_realm_name => owned
  /userA/my_realm_name => /userA/my_realm_name => unowned
  /userB/my_realm_name => /userA/my_realm_name => unowned
  /my_realm_name       => /my_realm_name       => unowned
于 2017-05-15T15:36:46.973 回答