[Zope-PAS] Asymmetry between ZODBRoleManager and ZODBGroupManager

Willi Langenberger wlang at wu-wien.ac.at
Sun Dec 19 13:30:47 EST 2004


Hi!

Both PAS plugins (ZODBRoleManager and ZODBGroupManager) have a
"principal search form" (available when clicking on the 'assignments'
column):

  Principal ID  _________________  [search]

Those forms look identical, but can yield different results.

Reason: these forms call the functions 'listAvailablePrincipals' in
ZODBRoleManager.py and ZODBGroupManager.py respectively, which in turn
call the PAS searchPrincipals method. However, it is called
differently: the role plugin uses the search string as the 'id'
keyword argument, whereas the group plugin uses the search string as
the 'name' keyword argument:

ZODBRoleManager.py:
    [...]
    def listAvailablePrincipals( self, role_id, search_id ):
        [...]
        if search_id:  # don't bother searching if no criteria

            parent = aq_parent( self )

            for info in parent.searchPrincipals( max_results=20
                                               , sort_by='id'
                                          ===> , id=search_id  <===
                                               , exact_match=False
                                               ):

ZODBGroupManager.py:
    [...]
    def listAvailablePrincipals( self, group_id, search_name ):
        [...]
        if search_name:  # don't bother searching if no criteria

            parent = aq_parent( self )

            for info in parent.searchPrincipals( max_results=20
                                               , sort_by='id'
                                          ===> , name=search_name  <===
                                               , exact_match=False
                                               ):

Is this asymmetrie intended? If yes, what was the reason for this? I
find it somewhat confusing...


\wlang{}

-- 
Willi.Langenberger at wu-wien.ac.at                Fax: +43/1/31336/9207
Zentrum fuer Informatikdienste, Wirtschaftsuniversitaet Wien, Austria


More information about the Zope-PAS mailing list