Ok i think it s gettin clearer for me. I based my learning on the example
apps couchbase(todolite or couchChat) and they dont assign userID(in the
sense of couch sync accounts) to channels, it s more documentId. Anyways so
let me summarize what i understood from here:
1- i need to do a curl put request to add an indefinite number of accounts(
i dont know how many users will download. And launch the app).
2- i need to then add these in couchsync key "users" And individually
setting admin channels to "survey-user1", "survey-user2"....etc
3- only after step 2, can the SG filter my "survey" document through the
requireUser(doc.ClientID) with clientID being the _id of my other document
"Client" similarly to the owner property in the List Document which is used
to differentiate list documents by profiles.
4- is there a concrete couchsync config that shows filtering the syncing
and updating without having a definite set of users or where the new users
who create their documents or want to access some "public"
Ones is possible. My scenario: user launches app-->fill textfields- clicks
button profile document created and can only sync his--> can read views in
public channels---> can fill a survey documents which has as a property the
profile document _id and can only sync his survey document.

Sorry for the inconvenience,


On Friday, March 13, 2015, Jens Alfke <[email protected]> wrote:

>
> On Mar 13, 2015, at 11:23 AM, Souhail Marghabi <[email protected]
> <javascript:_e(%7B%7D,'cvml','[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 a topic in the
> Google Groups "Couchbase Mobile" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mobile-couchbase/UqelTaQDcnc/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected]
> <javascript:_e(%7B%7D,'cvml','mobile-couchbase%[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
> <https://groups.google.com/d/msgid/mobile-couchbase/5EF720A5-9E30-4441-A1F2-7995BBE5AD02%40couchbase.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAH-sp5DAQvKfoRj%3DW%3Dski_%2B-xofjnLijZh2O51DHVYGMRuk79w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to