[Zope] manage_defined_roles pb.

ender kthangavelu@earthlink.net
Sun, 8 Jul 2001 09:55:49 -0700


On Sunday 08 July 2001 12:05, Didier Georgieff wrote:
>>Hello,
>>
>>I've created a Zclass, with a need for some roles.
>>So i've created a setup method (localized on the root folder) for
>>adding this role.
>>
>>Looking at the ZMI code shows that this should work.
>>
>> <dtml-call "REQUEST.set('role','PopotoGest')">
>> <dtml-call "REQUEST.set('submit','Add Role')">
>> <dtml-call "manage_defined_roles(REQUEST['role'],REQUEST['submit'],)">
>>
>>This raise no error BUT doesn't create the role.
>>Did I missed something ? And what ?

i'm not sure how to do it from dtml but, from a python external method you 
can just do

def create_roles(folder, role_list):
    for role in role_list
	folder.__addRole(role)

hth,

kapil