[Zope] mysqlUserFolder and CMF - UPDATE

Vladimir Petrovic vladap@europe.com
Thu, 26 Apr 2001 14:05:56 +0300


Sorry, I accidentally pressed send :-)

> (6) Having got couple of errors when trying to add a new record, this
> being:
>
> 	(a) 	Error Type: Forbidden
> 		Error Value: Get lost you stupid boy. You are not authorized to access
> this document.
-----------------------------------------------
>                 user_create__roles__ = None
>         def user_create (Self, REQUEST, username, realname, email,
> password):
>                 """ Anonymous creation """

There are two functions for creating new users:
manage_users_create () and create_user ().
First one is used from management screens, and it requires role 'Manager'.
Second one is used for users that that create their accounts over internet. 
Anonymous can call it, but when you create mysqlUserFolder instance you have 
to allow anonymous user creation (if statement checks that).


> (b) Then I got the following error which is as follows: (Please note I had
> to restart the server everytime I made any changes to any of the code)
>
> Error Type: Unknown role: Select Id from Roles where Rolename = %s and
> Realm = %s
> Error Value: None
>

When creating new user using user_create (), mysqlUserFolder will 
automatically assign him role that is specified when mysqlUserFolder is 
created. You probably left that field empty, so that's why you get the error. 
You don't need to change the code, just put 'Members' as anonymous creation 
role.

Vladimir