[Zope] [Search] Documentation for "__guarded_*__"

Dieter Maurer dieter@handshake.de
Thu, 22 Aug 2002 21:03:59 +0200


I am searching documentation for "__guarded_getattr__", "__guarded_setattr__"
and friends.

The name suggests they should guard. Thus a definition

    __guarded_getattr__= __getattr__

is probably not very wise. Is the following definition correct
when I want the dynamic attributes (defined by "__getattr__")
to be protected in the same way normal attributes are:

   def __guarded_getattr__(self,attr):
     r= getattr(self,attr)
     if getSecurityManager().validate(accessed=self,
                                      name=attr,
				      value=r)
       return r
     raise Unauthorized, attr
     

Dieter