Restrict deleting documents


#1

Hi Team,

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.

Thanks,

Ajinkya Udgirkar


#2

I don’t know anything about PouchDB inspector (and how you’d prevent updates to the local database), but you would use the Sync Function on the Sync Gateway side to enforce write restrictions:
http://developer.couchbase.com/documentation/mobile/1.2/develop/guides/sync-gateway/sync-function-api-guide/index.html