Commit ca33bdd3 authored by Chris McDonough's avatar Chris McDonough

Instead of referring to user folder by its ZMI-visible username (acl_users)

when attempting to get a list of users, use the __allow_groups__ alias.
This doesn't break anything as it is one of the (unwritten) contracts
of a user folder to install itself as __allow_groups__ in its container
(it is canonized in the manage_beforeDelete and manage_afterAdd methods
of BasicUserFolder, and the traversal machinery refers to a user folder
by its __allow_groups__ alias exclusively).

It's actually likely that all code in Zope's security machinery that directly
refers to a user folder by its 'acl_users' alias in this way is wrong.

Referring to the user folder by its __allow_groups__ alias in the security
machinery exclusively gives us the ability to insert a "proxy" object as
can act as an intermediary for a "real" UserFolder object, allowing us to
massage the output from its interface methods as necessary to allow for
grouping and other tricks.
parent 8a7ff3a5
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
############################################################################## ##############################################################################
"""Access control support""" """Access control support"""
__version__='$Revision: 1.55 $'[11:-2] __version__='$Revision: 1.56 $'[11:-2]
from Globals import DTMLFile, MessageDialog, Dictionary from Globals import DTMLFile, MessageDialog, Dictionary
...@@ -307,7 +307,7 @@ class RoleManager(ExtensionClass.Base, PermissionMapping.RoleManager): ...@@ -307,7 +307,7 @@ class RoleManager(ExtensionClass.Base, PermissionMapping.RoleManager):
dict={} dict={}
_notfound = [] _notfound = []
while 1: while 1:
aclu = getattr(aq_base(item), 'acl_users', _notfound) aclu = getattr(aq_base(item), '__allow_groups__', _notfound)
if aclu is not _notfound: if aclu is not _notfound:
mlu = getattr(aclu, 'maxlistusers', _notfound) mlu = getattr(aclu, 'maxlistusers', _notfound)
if type(mlu) != type(1): mlu = DEFAULTMAXLISTUSERS if type(mlu) != type(1): mlu = DEFAULTMAXLISTUSERS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment