[Zope-PTK] Re: [Zope-dev] Membership and Local Roles

Michael Bernstein webmaven@lvcm.com
Mon, 18 Sep 2000 18:48:55 -0700


I figured out how to get this to work (finally).

In the acl_users LM, add the following two Python methods:

- getUserNames -------------------------------------

Parameter List:

self


Body:

 user_ids=self.UserSource.getPersistentItemIDs()

 names=[]
 for i in user_ids:
     names.append(i)
 return names

----------------------------------------------------


- user_names ---------------------------------------

Parameter List:

self


Body:

 return self.getUserNames()

----------------------------------------------------

And whatever users or members you've got that are stored
persistently within the User Source will appear in the local
roles screen (manage_listLocalRole).

Preliminary tests show that local roles defined for
LoginManager/Membership users work just as expected.

Thanks to Bill Anderson for pointing out the difference
between returning a list of objects and a list of names,
which was the critical bug in the getUserNames method.

Michael Bernstein.