[Zope-CMF] Assigning roles to new users (newbie question)

alan runyan alan runyan" <runyaga@runyaga.com
Wed, 11 Sep 2002 16:29:33 -0500


James,

please dont post HTML to the mailing list.

- look at portal_memberdata
- register.py does not monkey w/ Roles.  it only touched memberdata.
- look to acl_users Folder for setting Roles

~runyaga


----- Original Message -----
From: James Walker
To: zope-cmf@zope.org
Sent: Wednesday, September 11, 2002 8:49 PM
Subject: [Zope-CMF] Assigning roles to new users (newbie question)


Hi,

I am trying to develop a site using plone and need to setup 2 types of users
which I have called 'customer' and 'associate'. I have created roles for
these and added a radio box on a cutom version of the join_form. Then I have
modified the register.py as follows:

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

# my bit

r = ('Member')
if (REQUEST['membershiptype'] == 'customer'):
         r = ('Member', 'customer')
else:
         r = ('Member', 'associate')

portal_registration.addMember(REQUEST['username'], password, roles=r,
properties=REQUEST)

# end of my bit

if portal_properties.validate_email or REQUEST.get('mail_me', 0):
...

to check and set up the appropriate type of account, however it doesn't seem
to work, can anyone help me?

(I am also a newbie to zope and python)

Cheers

James