[Zope-PTK] Poll results, and local roles fix

Michael Bernstein webmaven@lvcm.com
Fri, 22 Sep 2000 23:50:42 -0700


Hi all,

Well  the results from my 'local roles' poll were
interesting. Only five people responded, but three gave it a
'5 - Critical/Immediate Need' and two gave it a '4 - Very
Important' rating.

Apparently, no one who didn't care about the issue even
bothered to respond.

Meanwhile, The situation has been largely resolved.

First, the User Source needs to support a getUserNames
method. This can be done two ways:

You can add a Python method to the LoginManager named
getUserNames that takes a 'self' parameter, and has the
following body:

 user_ids=self.UserSource.getPersistentItemIDs()

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

Or you can add the following code directly to the
PersistentUserSource.py file, preferably right befor or
after the getUsers method:

    def getUserNames(self):
        user_ids=self.getPersistentItemIDs()
        names=[]
        for i in user_ids:
            names.append(i)
        return names

Next we need to provide a user_names method in the
LoginManager. Currently I only have a Python method to drop
in to the LM. it takes a 'self' parameter, and has the
following body if it's calling another Python method:

return self.getUserNames()

Or if you're calling the method in PersistentUserSource.py,
it has this body:

return self.UserSource.getUserNames()

Note that this user_names method has some disadvantages, and
it needs to be generalized to deal with multiple User
Sources that aren't all named UserSource, and that may not
all implement the getUserNames interface, and that may have
duplicate user names in them.

Suggestions on how to do this would be welcome.

Note that the current PortalMembership (0.7.6) has a
platform dependent bug that breaks password authentication
on Solaris and HPUX (possibly other Unices as well), but
works perfectly fine under Linux. According to Bill
Anderson, it has to do with the crypt module.

I hope that this little set of instructions helps others who
are trying to integrate LM with the existing security
interface and local roles.

Comments, testing, and improvements would be welcomed.

HTH,

Michael Bernstein.