[Zope] Adding Role Programmatically

Dieter Maurer dieter@handshake.de
Mon, 17 Feb 2003 19:48:34 +0100


Samir Mishra wrote at 2003-2-17 09:49 +0400:
 > This is probably simple, but I'm unable to find anything on it.
 > 
 > I'm trying to add a new role to a new folder using a Python script, and am
 > using -
 >     context.manage_addFolder(fldr, folders[fldr], 1, 1) # folders is a
 > dictionary
 >     # create a new folder named 'fldr' 
 >     newFolder = getattr(context, fldr)
 >     # create reviewer role in folder
 >     newFolder.manage_addRole('Reviewer')
 > 
 > The last line generates the following error -
 > Line 20: "_addRole" is an invalid attribute name because it starts with "_".

Are you sure?

  I do not see "_addRole" in your code.

Maybe, you post the traceback (and the precise error message) as well.


Dieter