[Zope] Siteaccess problems

Evan Simpson evan@4-am.com
Tue, 29 Feb 2000 19:16:39 -0600


----- Original Message -----
From: Stefan Langerman <lfalse@cs.rutgers.edu>
> 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.

This is from the "Other Uses" page, right?  In that example, it is an error
to access the folder, since it is only meant to act as a placeholder for a
session value.  The IndexError occurs when the code tries to access the last
element in the remaining path, but there *is* no remaining path!

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

Access Rules execute before any authentication takes place, so
AUTHENTICATED_USER doesn't exist yet.  This also prevents them from
accessing any other Zope objects unless you give the Rule a Proxy role.

It looks like you need GenericUserFolder or UserDB.

Cheers,

Evan @ 4-am & digicool