Hi, I have a portal, that can have members. The member data ist stored in zclass instances (called Member) and at the same in normal zope users in UserFolders. If a member has the "admin" role, I want the member to be able to add another member. For this I wrote a script called "newMemberAction" (see bottom), which should create a new user and Member instance for the passed member data. I gave this script the proxy role "Manager". When I execute the script, I keep geting a login dialog. When I remove the line container.members.manage_addProduct["Member"].Member_add(Vorname,Nachname) it works (but of course does not create the Member instance). Why can I not create this zclass isntance? Thanks Eddy Heres the script (compressed): ---------------------------------------------------- ....... if not ('Admin' in request.AUTHENTICATED_USER.getRoles()): raise 'Unauthorized' ...... container.members.manage_addProduct["Member"].Member_add(Vorname,Nachname) Password=generatePassword() container.acl_users.manage_users('Add',{"name":Vorname+'.'+Nachname,"password":Password,"confirm":Password,"roles":[],"domains":[],}) getattr(container.members,id).manage_setLocalRoles(Vorname+'.'+Nachname,["Owner"]) RESPONSE.redirect("newMemberConfirm?Vorname="+url_quote(Vorname)+"&Nachname="+url_quote(Nachname)+"&Password="+url_quote(Password)) ----------------------------------------------------
From: "Eddy Ilg" <eddy@fericom.net>
I have a portal, that can have members. The member data ist stored in zclass instances (called Member) and at the same in normal zope users in UserFolders.
If a member has the "admin" role, I want the member to be able to add another member.
For this I wrote a script called "newMemberAction" (see bottom), which should create a new user and Member instance for the passed member data. I gave this script the proxy role "Manager".
When I execute the script, I keep geting a login dialog. When I remove the line container.members.manage_addProduct["Member"].Member_add(Vorname,Nachname) it works (but of course does not create the Member instance).
Why can I not create this zclass isntance?
Does the 'members' folder have a security setting which enables 'Managers' to add your zclass instance? Jonathan
Eddy Ilg wrote at 2005-3-9 10:18 +0100:
... When I execute the script, I keep geting a login dialog. When I remove the line container.members.manage_addProduct["Member"].Member_add(Vorname,Nachname) it works (but of course does not create the Member instance).
Reconfigure your "error_log" object not to ignore "Unauthorized" exceptions. Reproduce the error and look at the resulting traceback in your "error_log". Come back (with the traceback) in case, the information is not easily understandable (this will probably be the case). -- Dieter
participants (3)
-
Dieter Maurer -
Eddy Ilg -
Jonathan Hobbs