Hi, sofar I solved the creation process of user accounts. This was quite easy after I read the code for this. But now I have problems adding new roles via a specialized interface. I setup tghe REQUEST object correctly, then I call manage_defined_roles and I get various errors. Is their any method at all to create Roles besides the management interface of Zope or via External Methods? Setting local roles is easy, but I can get the role added to the system at all. Any help appreciated. Thanks a lot. Bye, Oliver
Oliver Andrich wrote:
Hi,
sofar I solved the creation process of user accounts. This was quite easy after I read the code for this. But now I have problems adding new roles via a specialized interface. I setup tghe REQUEST object correctly, then I call manage_defined_roles and I get various errors.
What kind of errors?
Is their any method at all to create Roles besides the management interface of Zope or via External Methods?
You should be able to call a method that adds roles just like the managment interface does. Have you checked out lib/python/AccessControl/access.dtml? At the bottom is a second form that lets you add roles. -Michel
Hi, well I use the following code snippet in my factory method of the product I am developing. <dtml-with "manage_clone(Home, REQUEST['new_id'], REQUEST)"> <dtml-call "manage_changeProperties( company_name=REQUEST['new_company_name'], title='OS Job Tracking System für ' + REQUEST['new_company_name'] )"> <dtml-call "acl_users.manage_users(submit='Add Role', REQUEST=REQUEST)"> <dtml-call "manage_defined_roles(submit='Add Role', REQUEST=REQUEST)"> </dtml-with> I set the role element of my REQUEST object to a string, which is the name of the new role. When I look a manage_defined_roles in lib/python/AccessControl/Roles.py it searches for a submit element in the REQUEST object that has a certain value. Otherwise it calls manage_access. Well, I set submit to the required value, so that _addRole is called. Then I get the error Error Type: AttributeError Error Value: aq_acquire And when I call it without setting the parameters at all Error Type: KeyError Error Value: SCRIPT_NAME When I call it with REQUEST=REQUEST I get the first error again. Any idea what is wrong with my call? I am not using any external method or so from product, but I develop the product in Zope and use only DTML scripting, cause this is sufficient for my task. I am running Zope 2.1.4 as a standalon zserver. May be this helps too. Any hint would be really fine. Best regards, Oliver Andrich On Mon, Mar 20, 2000 at 11:03:15AM -0800, Michel Pelletier wrote:
Oliver Andrich wrote:
Hi,
sofar I solved the creation process of user accounts. This was quite easy after I read the code for this. But now I have problems adding new roles via a specialized interface. I setup tghe REQUEST object correctly, then I call manage_defined_roles and I get various errors.
What kind of errors?
Is their any method at all to create Roles besides the management interface of Zope or via External Methods?
You should be able to call a method that adds roles just like the managment interface does. Have you checked out lib/python/AccessControl/access.dtml? At the bottom is a second form that lets you add roles.
-Michel
Hi, I just discovered something strange. At least I think that it is strange. I can assign users Roles that don't exist at all in the system. In my last Email I tried to create a Role in a system wide context. Well, know I removed the role add code and just added the user with a fantasy role. Now the management screen can't handle the user anymore cause the role doesn't exist. But when I do a acl_users.getUser('admin').getRoles() I get the fantasy role I specified. Ok, this is not the solution, but should the manage_user code check if the role that is specified exists at all? Bye, Oliver
Hi Oliver - would you expand a little bit on how you "solved the creation process of user accounts?" Thank you. Regards, Mitch Duvall __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com
participants (3)
-
Michel Pelletier -
Mitch Duvall -
Oliver Andrich