[Zope] REQUEST problems

Dieter Maurer dieter@handshake.de
Thu, 30 Aug 2001 22:50:35 +0200 (CEST)


jonathan writes:
 > I am reletively new to zope, and in particular to products, so please
 > accept my appologies if I am asking silly questions.
 > 
 > I have in fact nearly completed my first ever product.
 > The product was developed on a installation of Zope 2.4.0 and is giving
 > errors when used with Zope 2.3.2.
 > 
 > The error only occours when a method of the product is called directly
 > from the web.
 > The error does not occour when a dtml method is called that contains a
 > reference to a method of the product.
 > 
 > The error itself is that it can not find the object AUTHENTICATED_USER.
 > Printing out REQUEST confirms this.  There is no AUTHENTICATED_USER.
 > Again this only happens when calling a method of the product directly.
 > 
 > e.g. browsing http://zope-site/product/method generates an error but
 > http://zope-site/dtml_method does not, even when dtml_method contains
 > <dtml-var expr="product.method(REQUEST)">
 > 
 > 
 > Is this some sort of bug that was fixed in Zope 2.4.0 or has the way
 > things should be done changed between versions?
Seems that your "method" is public.

   In this case, Zope did not bother to authenticate the user.
   Will look similar to what you see.

Protect your method with a permission that usually all
your visitors get, such as "View".
Then, the behaviour should vanish.


Dieter