[Zope] context.user at ImplPython.py

Martijn Pieters mj at zopatista.com
Fri Mar 23 04:04:57 EDT 2007


On 3/22/07, Garito <garito at sistes.net> wrote:
> I debug ImplPython.py to try to understand why my code don't work ok
>
> If you remember my last threat I wonder why some actions marked as Manager
> execute ok but other not
> You could refresh your mind about it at:
> http://archives.free.net.ph/message/20070312.184003.211597ad.en.html
>
> When validate (line 237) try to evaluate if the user is autenthicated and
> has right roles (line 436) the self._authenticated is set to TRUE but
> context.user is Anonymous User even when I'm authenticated to Garito
>
> Is this normal? (this is what causes the error for me)

I've seen this happen when creating views in combination with
PlonePAS. The issue is that the user authentication hasn't taken place
yet at traversal time (when the view is instanciated). Moving the
user-dependant code to render time (view.__call__ and methods used in
the view template or somesuch) the problem is circumvented.

-- 
Martijn Pieters


More information about the Zope mailing list