MongoDB Realm Sync Permissions

I have been playing around with Sync permissions. I have noticed that if one gives a ‘true’ value to the write permissions, it does not matter what restrictions are placed on the read permissions, i.e. write ‘true’ basically implies ‘read’ true, or trumps the read permissions. To me this feels like a bug. Maybe I am missing something.

@Richard_Krueger This is by design - if you have write permissions on a partition then you implicitly have read permissions on that partition. What’s the use case for having write but not read?

@Ian_Ward actually there is no use case for write without read. I discovered this issue by messing around with the read permissions and finding out that what I was doing had no effect, because of the “true” in my write permissions. Only after turning off the write permissions was I able to see the effect of my read permissions. Call me old fashion, but this went counter to my Unix purist sensibilities, where read and write are independent variables.

My suggestion would be to add something in the documentation to that effect that permissions granted to “write” will automatically convey to “read” permissions.

@Richard_Krueger its here - https://docs.mongodb.com/realm/sync/rules/#overview

Whenever a user opens a synced realm from a client app, Realm evaluates your app’s rules and determines if the user has read and write permissions for the partition. Users must have read permission to sync and read data in a realm and must have write permission to create, modify, or delete objects. Write permission implies read permission, so if a user has write permission then they also have read permission.

1 Like

“Write permission implies read permission, so if a user has write permission then they also have read permission.” - I stand corrected.