[Zope] roles & permissions newbie question

Dieter Maurer dieter@handshake.de
Thu, 21 Jun 2001 21:43:08 +0200 (CEST)


Albert Ting writes:
 > I know this has been done, but I don't know how to do it myself.  I'm
 > trying to write a html page where some parts gets displayed only if the
 > user has logged in.  If the person is not logged in, it should display some
 > generic text, with perhaps a "login" button somewhere.
Look at the methods in "AccessControl.DTML".
They allow you check various aspects of the current user.

 > I'm also trying to
 > do this from an external method.
It is very nasty, that the methods of "AccessControl.DTML"
are not exposed to Python Scripts and External Methods.
Someone did not think enough at this point...

There is an alternative way: getSecurityManager.
It is defined in "AccessContol" and returns a
"SecurityManager". It, too, allows to check various aspects
of the current user.

It can be accessed from Python Script and External Method
but not easily from DTML....



Dieter