Realm Global file stop working with Realm 3.7.2
See original GitHub issueHi there, I was having a global realm file that was shared among users. Users where able to shared content. However, since I updated to 3.7.2, I am not able to share content between users.
This is how user login
SyncUser.loginAsync(SyncCredentials.usernamePassword(eMail, password, true), AUTH_URL, new SyncUser.Callback() {…
where
AUTH_URL = "http://" + BuildConfig.OBJECT_SERVER_IP + ":9080/auth";
The global file is:
COMMON_REALM_URL = "realm://" + BuildConfig.OBJECT_SERVER_IP + ":9080/" + REALM_NAME;
and the configuration is:
SyncConfiguration commonRealmConfiguration = new SyncConfiguration.Builder(user, COMMON_REALM_URL).build();
Realm.setDefaultConfiguration(commonRealmConfiguration);
I adapted my code according to the documentation for Realm 3.7.2 to grant permission. When the global file is created, the admin user grant permissions to all users as follows:
private static void setPermissionsDefaultRealm(SyncUser user){
if (user.isAdmin()){
PermissionManager pm = user.getPermissionManager();
UserCondition condition = UserCondition.noExistingPermissions();
AccessLevel accessLevel = AccessLevel.WRITE;
PermissionRequest request = new PermissionRequest(condition, COMMON_REALM_URL, accessLevel);
pm.applyPermissions(request, new PermissionManager.ApplyPermissionsCallback() {
@Override
public void onSuccess() {
}
@Override
public void onError(ObjectServerError error) {
}
});
}
}
There is not trace or error showing that something is going wrong. The problem is that when I query the file, only returns results for the logged user. I am doing something wrong?
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (8 by maintainers)

Top Related StackOverflow Question
In the meantime, I found a relevant integration test which could give some ideas: https://github.com/realm/realm-java/blob/0c9c0282d3cfd4b6f8e48cc418fcc9a492446720/realm/realm-library/src/syncIntegrationTest/java/io/realm/PermissionManagerTests.java#L758-L807
@ojarabo any updates? can we close this issue?