[Zope] Adding Role Programmatically

Dieter Maurer dieter@handshake.de
Tue, 18 Feb 2003 22:47:29 +0100


Samir Mishra wrote at 2003-2-18 08:25 +0400:
 > ...
 > Sorry about the confusion this may have caused. I'm still looking for a
 > solution, but I can't figure it out. The source code indicates I ought to be
 > able to use "_addRole".

You cannot use names starting with "_" in TTW code (i.e. Through-The-Web
editable code, such as PythonScripts or DTML/ZPT objects).
They are considered private.

However, you can do it in an External Method.

Moreover, as the ZMI (Zope Management Interface) can add roles,
you can do it, too. Look at the ZMI source to find out which
methods it uses for this purpose. Call them in your script.


Dieter