Create Realm with regular user


#1

hi,

I create with my admin user a global realm /test/ and set the permisson for everyone to admin.

let creds = SyncCredentials.usernamePassword(username: "admin", password: "test")
        SyncUser.logIn(with: creds, server: Constants.syncAuthURL, onCompletion: { (user, err) in
            if let user = user {
                var config = user.configuration(realmURL: Constants.commonRealmURL)
                config.objectTypes = [Person.self, Team.self]
                let realm = try! Realm(configuration: config)
                let permission = SyncPermission(realmPath: realm.configuration.syncConfiguration!.realmURL.path,
                    identity: "*",
                    accessLevel: .admin)
                user.apply(permission) { error in
                    if let error = error {
                        print("Error when attempting to set permissions: \(error.localizedDescription)")
                        return
                    } else {
                        print("Permissions successfully set")
                    }
                }
            }
        })

then i would like to create a sub-realm /test/myteam with my regular user but I always get:

A non-admin user is not allowed to create realms outside their home folder

on the cloud log. How can i permit a non admin user to create a realm inside my global realm /test/?