I am using Couchbase's Sync Gateway and want to restrict the access to the documents. Furthermore, the individual restriction for each document should take into account what is currently happening: The document is just being read or it is either being created or changed in some way. To this end, I can use oldDoc
and deleted
:
- create: oldDoc will be undefined
- read: ???
- update: oldDoc is an object without the property
deleted : true
- delete: oldDoc is an object with the property
deleted : true
Basically, "CUD" is documented. What I have not found out so far, is how I restrict the Read access to the documents.
E.g. there may be an admin user who is allowed to create, update and delete a specific type of document (and of course see it). A normal user on the other hand would only be allowed to see this document but could neither create nor update / delete it.