I am using pouchdb with sync gateway to sync documents from Couchbase to the browser.
Using pouchdb inspector the user can make changes to these documents.
So, my question is, is there a way that we can stop user from modifying the document via pouchdb inspector?
Also, even if the user modifies the document via pouchdb inspector, is there a way that I can stop this updated document to be synced back to the Couchbase server?
Please let me know your thoughts on this.
Short answer: No.
Slightly longer answer: The user is the "admin" of their local data in a web browser. They have absolute power over the pouch, and you can't take it away.
Validation functions might help you out though.
http://docs.couchdb.org/en/1.6.1/couchapp/ddocs.html or http://guide.couchdb.org/draft/validation.html
Your function should look for _delete === true on the document or something similar and throw({forbidden : message}).
You can add these to the PouchDB. Unfortunately the user could just delete the validation document, then delete the other documents.
If you added it to the CouchDB, it wouldn't prevent users from messing with the pouch, but the deletions wouldn't sync to the couch.