[Zope] proxy roles

Eddy Ilg eddy at fericom.net
Wed Mar 9 04:18:28 EST 2005


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))
----------------------------------------------------






More information about the Zope mailing list