[Zope-PAS] Proposed patch for allowing plugins to be able to have influence over title.

Chris McDonough chrism at plope.com
Sat Nov 6 04:47:07 EST 2004


Here's a proposed patch to PAS to allow a user/group enumerators to have
influence over the title of the group or user.  It should be 100%
backwards compatible.

The reason this is necessary is because the "id" of a user or group may
not be printable or have any real meaning.  This is the case for userids
based on binary data (in my case, ActiveDirectory's "objectGUID" value,
which is the only AD attribute that is guaranteed to remain constant
over the lifetime of the user or group, making it the only real choice
for a user/group identifier).

If you give the green light, I'll check it in.

Index: PluggableAuthService.py
===================================================================
RCS file:
/home/dixonhughes_com/cvs_efr/Products/PluggableAuthService/PluggableAuthService.py,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 PluggableAuthService.py
321c321,322
<                         info[ 'title' ] = info[ 'login' ]
---
>                         if not info.has_key('title'):
>                             info[ 'title' ] = info[ 'login' ]
358c359,360
<                     info[ 'title' ] = info[ 'login' ]
---
>                     if not info.has_key('title'):
>                         info[ 'title' ] = info[ 'login' ]
403c405,406
<                         info[ 'title' ] = "(Group) %s" % principal_id
---
>                         if not info.has_key('title'):
>                             info[ 'title' ] = "(Group) %s" %
principal_id
426c429,430
<             kw['title'] = kw['name']
---
>             if not kw.has_key('title'):
>                 kw['title'] = kw['name']
440c444,445
<                     info[ 'title' ] = "(Group) %s" % info[ 'groupid' ]
---
>                     if not info.has_key('title'):
>                         info[ 'title' ] = "(Group) %s" % info[
'groupid' ]
471c476,477
<             kw['title'] = search_name
---
>             if not kw.has_key('title'):
>                 kw['title'] = search_name
486c492,495
<                         title_key = 'login'
---
>                         if kw.has_key('title'):
>                             title_key = 'title'
>                         else:
>                             title_key = 'login'
494,495c503,508
<                         title_key = 'groupid'
<                         title_pattern = "(Group) %s"
---
>                         if kw.has_key('title'):
>                             title_key = 'title'
>                             title_pattern = "%s"
>                         else:
>                             title_key = 'groupid'
>                             title_pattern = "(Group) %s"
506c519,520
<                         info[ 'title' ] = title_pattern % info[
title_key ]
---
>                         if not info.has_key('title'):
>                             info[ 'title' ] = title_pattern % info[
title_key ]






More information about the Zope-PAS mailing list