2009/4/9 Alexander <[email protected]>: > Hi folks > > I'm thinking about using couchDB for the next project, but I have a few > questions regarding the possibility to replicate docs with permissions > respect. > Let me to start with an example. Lets's say we have a database which holds a > products. Each product is a document with a simple structure: > > Product > { > "_id": 123, > "category":"category_id_here" > "name": "product1", > "description": "product1 description" > } > > Category > { > "_id": 123, > "name": "name" > "parent_id": "12" > } > > Lets's say we have a category tree: > > brands / > some_brand1 / > Product 1 > Product 2 > Product 3 > some_brand2 / > Product 5 > Product 6 > Product 7 > > We also have a two managers: Manager1 is responsible for products in > some_brand1 category and Manager2 is responsible for products in some_brand2 > category. Each person can manage products ONLY in his own category. Here is a > small mockup of how we want to work. > http://img209.imageshack.us/img209/5048/couchdb.png > > So each manager should be able to replicate data only from his own category. > Possible? Not possible? Will be possible in future? > >
You need to distinguish between read permissions and write permissions. Currently it is possible to restrict changes to a given document to users who are listed on that document itself. This restriction will hold for inbound replication as well as local edits. Outbound replication is just reading, which does not have access control at this time. Validation functions are applied on update, to local edits as well as to inbound replication. -- Chris Anderson http://jchrisa.net http://couch.io
