[Zope] Problems changing user roles

Víctor Pascual Cid victor.pascual at upf.edu
Thu Jun 3 06:02:51 EDT 2004


Hi all!!

I'm newbie on the Zope development.
I'm creating a site using Zope + Plone. The site will have several new roles because there will be some folders only accessible for some users. So I need to differentiate the different users when they sign in to the site, in order to give them they role. To do this, I've tried to change the "register" script. What I want to do is to get a new field from the "Sign on sheet" to know the role of the new user, and then add him with it. I'm attaching you my register code. As you will see, I just have changed the line that contains the addMember method, trying to set to the new user the "System developer" role, but it doesn't works. When I fill the "join_form", Zope redirects me to the "login_form" page.
Does anybody has any idea of what happens?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
REQUEST=context.REQUEST

portal_registration=context.portal_registration
site_properties=context.portal_properties.site_properties

username = REQUEST['username']

password=REQUEST.get('password') or portal_registration.generatePassword()

portal_registration.addMember(username, password, roles=('System developer'),properties=REQUEST)

...
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Thanks in advance.

    Víctor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20040603/9fee8a11/attachment.html


More information about the Zope mailing list