Hey guys, for my android application , i have a waiter role and an admin role. I have many waiters and only 1 admin.
I have added a document.changelistener to the document to listen for changes. However, i only want to listen when the admin has change the document and not the waiter. Any tips ?
Are waiters ever allowed to change the doc? If not, you can block replication in Sync Gateway (or just block them in your app based on how they log in).
Jens is suggesting adding an entry for the user role to the document. You can access the whole document in the listener, and pull out the user type to check.
It sounds like you might want to look more at channels and roles and how to control who can make changes through that on the Sync Gateway side.
Hey bro, yeah both admin and waiter are allowed to update that specific document but i only want to listener for the admin changes as they are something some default values.