[Zope] Siteaccess problems

Stefan Langerman lfalse@cs.rutgers.edu
Tue, 29 Feb 2000 13:24:34 -0500 (EST)


Hi,

I've had a couple of problems with SiteAccess. The first one 
appeared when I tried the sample code from the doc:

<dtml-unless "REQUEST.path[0][:6]=='manage'">
...

This Access Rule is placed in some directory foo. If I try 
to access http://my.site.org/foo I get:
  Error Type: IndexError
  Error Value: list index out of range
If I try http://my.site.org/foo/bar, there is no such problem. 

The second problem is the following: I am trying to set up 
siteaccess so that it checks for user authentification, and
redirects to a login screen if necessary. That way, I am
sure all authentification is cookie-based, and I don't get
the ugly error page in case of failure. So I tried:

<dtml-unless "REQUEST.path[0][:6]=='manage'">
	<dtml-unless "AUTHENTICATED_USER.has_role('Member')">
		redirect to login screen
	</dtml-unless>
</dtml-unless>

But then I get:
  Error Type: KeyError
  Error Value: AUTHENTICATED_USER
Which is weird, because if I try to render the method 
normally, it works. I tried replacing 
  <dtml-unless "AUTHENTICATED_USER.has_role('Member')"> 
by
  <dtml-unless "AUTHENTICATED_USER"> 
And I get the same result.

Last thing, I would like to be able to set the path to
the login screen ('foo/login'). What is the most elegant
way of doing that? I seem to also have permission problems 
when accessing methods like absolute_url() in the Access Rule.
This might be related to the previous problem.

Thanks a lot,

Stefan.