0

Since Realm is no longer recommending query-based sync (https://docs.realm.io/sync/using-synced-realms/choosing-your-sync-type#query-based-sync), I've decided to switch to full sync and now I'm facing a problem with the user permissions. I can't set them, by using User.applyPermissions(...), since the realms are already of reference type.

Here are my questions:

The other option I can think of, would be to re-create the realms as full type with different names and copy the data over.

Buzzkill
  • 68
  • 2
  • 8
  • The question is a tad confusing. You are switching to full sync but you're asking if there's a workaround for setting user permissions for reference realms? Then you asking about *converting them back to full*? Back from where? It appears you are trying to convert them to full, not back? Can you clarify? – Jay Mar 23 '20 at 18:35
  • I've updated my question. For query-based sync, I had to use `reference` realms. Now that I've switched to full sync, I can't set permissions using `User.applyPermissions(...)` to those `reference` realms. – Buzzkill Mar 24 '20 at 07:47
  • To clarify, your query sync realms have now been converted to full sync realms? – Jay Mar 24 '20 at 14:23
  • Yes, I've switched from `query based sync` (https://docs.realm.io/sync/using-synced-realms/choosing-your-sync-type#query-based-sync) to `full sync` https://docs.realm.io/sync/using-synced-realms/choosing-your-sync-type#full-sync. – Buzzkill Mar 24 '20 at 19:35
  • The [full-sync permissions](https://docs.realm.io/sync/using-synced-realms/access-control/path-level-permissions) work with full sync realms; we use them all the time. Looking at the question, I think it needs an update as you are asking how to *set user permissions ... for reference realms?* and you're not using reference realms, you're using Full Sync realms. You're also asking *Is it possible to convert a reference realm to full* and it sounds like you've already done that. Can you clarify the question and make it more specific? A code example of what the issue is would be helpful. – Jay Mar 25 '20 at 14:31
  • I'm not sure, if you're mixing up the `reference` & `full` realm types with the types of syncing (`query-based sync` & `full sync`). I'm currently using "reference" realms (open up realm studio -> realms -> `Type` column) with `full sync`. I haven't converted them from `reference` to `full` type (and I don't know if it's even possible). I've updated my question. – Buzzkill Mar 25 '20 at 16:53
  • *Reference Realm - The master Realm file which is used in query-based synchronization* from [Realm Types](https://docs.realm.io/sync/using-synced-realms/terminology#realm-types). Reference realms store the queried data from a partial sync so those go hand in hand (along with a partial Realm). If you're using Full Sync (which you should be) then the Realm Type is Full, sync type is Full. – Jay Mar 25 '20 at 18:10
  • @Buzzkill I am not able to sync data from realm using Full Sync. My user is a regular user not an admin. My configuration is : let config = SyncUser.current!.configuration(realmURL: "realms://***/shared", fullSynchronization: true). And i am opening realm using Realm.asyncOpen method. But i can see an error into Realm Studio log which says "The path is invalid or current user has no access.". – Rameez Apr 05 '20 at 11:44

1 Answers1

0

Leaving this in case anyone encounters this issue - recreate the realm as full and copy over your data, there doesn't seem to be a way around it.

Buzzkill
  • 68
  • 2
  • 8