[Zope] checking permissions

Dieter Maurer dieter@handshake.de
Tue, 30 Apr 2002 20:31:27 +0200


A M Thomas writes:
 > Thanks, Dieter!  This looks like exactly what I want.  Documented in the
 > Zope book and everything.
 > 
 > Of course, I'm trying to use it in a python script - tried
 > context.SecurityValidateValue(stuff) - and it's giving me an attribute
 > error, but I'm struggling with the flu and it could be anything.
It is very unfortunate (and unnecessary) that DTML and Python Script use
different security API's. Please file a feature request to the Collector.

In Python Scripts, you would use:

   from AccessControl import getSecurityManager

   getSecurityManager().validateValue(value)

In fact, that's what "SecurityValidateValue" does...


Dieter