Oh I see, thanks a lot :)

Just to be sure:

1. I have to manually add a .creator property to all my table in my iPad 
database, right?
2. When we say "user_id", "owner", "creator", etc. There are arbitrary 
names we choose as developers right ? There is no Couchbase special 
property like "type", or "rev" ?
3. I got how to prevent creating or updating documents. But how do I 
prevent a user to see other users' document ?
4. On last thing, sorry. In the couchbase-lite-iOS repository, the 
CBLIncrementalStore takes care of dynamically adding a "type" property to 
each document based on the table name in the datamodel. My idea was to do 
the same thing for "creator" property so it is automatically added in 
couchbase documents without having it in the datamodel since I consider it 
is a Couchbase (meta?)data that I don't need to know about since every data 
I have on the iPad was created by the user anyway.

Thanks, that helped a lot :)
Florion

Le mardi 2 juin 2015 19:19:32 UTC+2, Jens Alfke a écrit :
>
>
> > On Jun 2, 2015, at 2:36 AM, Florion COIFFÉ <[email protected] 
> <javascript:>> wrote: 
> > 
> > But where do I get this username ? Should I manually add a user_id 
> property to all my documents and call  access (doc.user_id, "VIP_channel") 
> ? 
>
> Something like that, yes. The sync function has no access to any state 
> that isn’t part of the document, so it has to get that user ID from the 
> document. 
>
> > A user in the local database has a Account table and all the other 
> tables a children of the Account table (not directly, is sub-children etc, 
> it's a tree). I would find it odd to manually add a user_id property to all 
> theses 52 tables since they all are related to a single Account table. 
>
> But consider the entire aggregate database in the Sync Gateway. Each 
> document should presumably keep track of who its owner is. That’s what that 
> user_id property does. 
>
> > When my iOS app connects to the sync gateway, It gets back a Session. 
> The session means that the user is granted access to the database. What I 
> would have thought is that each document created during that Session would 
> be automatically associated to the session's user 
>
> No, SG does not keep track of who pushed a document to it. In general the 
> creator of a document need not be the same as the “owner” of a document. 
> Access privileges are generalized enough that SG doesn’t hardcode one 
> specific type of access. 
>
> —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/b615907d-77f7-46b1-b7f9-77a65b3aca54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to