AW: [Zope-dev] Access problem.
Ignacio Dosil Lago
idosil@ccietic.usc.es
Thu, 26 Sep 2002 10:33:38 +0200
On Wednesday 25 September 2002 20:34, you wrote:
> > -- I am developing a CMF "link" product which defines its own travers=
e
> > method:
> >
> > def __bobo_traverse__(self, request, name=3DNone):
> > "Traverse method hook"
> >
> > if hasattr(self, name):
> > # return own attributes/subobjects
> > return getattr(self, name)
> > else:
> > t=3D self.getTarget()
> > if hasattr(t, name):
> > # return target's attributes/subobjects
> > return getattr(t, name)
> > else:
> > return t
> >
> > -- It works fine under the ZMI but when I try to access an object of =
this
> > product into a CMF portal using the CMF interface, Zope requests me l=
ogin
> > name and password (even if I am admin!!), which it doesn't accept, so=
the
> > only way to continue is to cancel instead of triying to log in.
>
> I had a similar problem when accessing the request object in
> __bobo_traverse__(self, request, name). Authentication didn=B4t work
> afterwards.
> I don=B4t what happens in getTarget() but maybe that=B4s the problem.
> Arndt
I don't thing the poblem is in getTarget() because when the exception is=20
thrown that method is never called. The exception is thrown when=20
"__bobo_traverse__" returns "getattr(linkObject, 'portal_url')" and only=
=20
when we are working with links in the CMF interface, not the ZMI.
Any suggestions/questions?
Kind regards.