> On Mar 13, 2015, at 11:23 AM, Souhail Marghabi <[email protected]> 
> wrote:
> 
> Ok, but how will i know the exact number of users accounts i need to manually 
> create in _user since its incremental for something like 
> channel("documentname+ doc.userId)? 
> Suremy i am misunderstanding something here

I think I’m not understanding what you want to do.

You’ll need a user account for every user that uses the app and replicates to 
Sync Gateway. When doing that, put the channel name “user-XXX” in the 
admin_channels property, where XXX is the userID. That defines a channel for 
docs for that user.

Then when the app creates a document, it puts the user ID in a property of the 
document. The SG can then use that to validate that documents are only updated 
by the users who own them, and it can assign a document to the channel 
“user-“+doc.userID, so that the user will have access to it (and probably no 
one else will, unless you specifically give another user access to that 
channel.)

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/5EF720A5-9E30-4441-A1F2-7995BBE5AD02%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to