I like the practice of providing context all the way down the call stack. However I think first class citizens should not be dictionaries. We can accomplish the same thing with a proper object that implements todict()/fromdict(). Devin On Sep 21, 2010, at 11:18 AM, vishvananda wrote: > My thoughts on data authentication: > First we turn context into a dictionary so it is easy to pass around everywhere. The dictionary contains the following important data: > {'request_id': , > 'user_id': ..., > 'project_id': ..., > 'superuser': > 'deleted' } > > superuser is set during authentication of the request, simply to avoid > roundtrips to the auth layer. > > My preference for a dictionary is simply that it is easy to pass through > rabbit. > > then inside the data layer, we have a simple check: > if context['superuser']: > # don't limit the sql > elif context['project_id']: > # add project_id = context > else: > raise > switch on deleted to add deleted=0, deleted=1 or ignore > > The user_id and request_id aren't used in the datalayer but are in > context to help with logging. > > On Sep 21, 2010, at 8:52 AM, Michael Gundlach wrote: > >> On Tue, Sep 21, 2010 at 8:16 AM, Soren Hansen