[Zope] Programattically adding roles Zope Folk <zope@zope.org>, '@reepicheep.avalongroup.net

Dieter Maurer dieter@handshake.de
Sun, 2 Jul 2000 23:35:27 +0200 (CEST)


Timothy Grant writes:
 > I know how to add users programatically, but I am having a difficult thing
 > finding out how to add roles programatically. I have a list of user defined
 > roles that I would like to add, but am unsure how to do it within DTML or an
 > external method.
 > 
 > Please note that I am *not* trying to assign roles to users here, I am just
 > trying to add roles to the system.
You can do anything programmatically, that you can do manually
through the management screen.
Just look at the DTML code that generates the respective form.


In your case (adding a role), the DTML source is
"AccessControl/access.dtml".

The analysis of the code shows you, that the
method "manage_defined_roles" does what you
want. It gets 2 keyword parameters: "role=your_role" and "submit='Add Role'".


Dieter