ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> zope-cmf
zope-cmf
[Zope-PTK] Re: [Zope-dev] Membership and Local Roles
by Michael Bernstein other posts by this author
Sep 18 2000 7:48PM messages near this date
[Zope-PTK] Re: [Zope-dev] Membership and Local Roles | [Zope-PTK] PTK/LoginManager/Membership - configuring User Sources
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.
Thread:
Michael Bernstein
Michael Bernstein
Michael Bernstein
Michael Bernstein
Michael Bernstein
Michael Bernstein
Michael Bernstein
Steve Alexander
Bill Anderson
Michael Bernstein
Michael Bernstein
Michael Bernstein

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved