Setting permissions with SyncPermissionValue not working with synchronous realm

I created a Realm with an Admin account and I want all other users to be able to read / write from this shared area. According to the docs, this should do the trick as I am using *

for userId. However, this does not work as I cannot pull any of the custom objects in this realm from the Realm Object Server if I am logged into an account other than admin. Also, when I log into the Realm Object Server with my administrator account, the default permissions say "no access" for each domain. The console prints this while I try to apply permissions for my admin account:

Domain error = io.realm.sync.permission Code = 1 "The path is invalid or the current user does not have access." UserInfo = {NSLocalizedDescription = Invalid path or current user does not have access., StatusCode = 614}

I know the path is correct because I can instantiate the scope using SyncConfiguration

with this path.

Versioning: RealmSwift 2.8.3, iOS 10.3.2, Xcode 8.3.3, ROS 1.7.6

let permission = SyncPermissionValue(realmPath: RealmURL.userObjects.absoluteString, userID: "*", accessLevel: .write) // may write
SyncUser.current!.applyPermission(permission) { (error) in
if let error = error {
    print(error)
}

      

+3


source to share





All Articles