[Zope] SimpleUserFolder and local roles

Stefan H. Holek stefan at epy.co.at
Sun Nov 16 12:01:24 EST 2003


There is a "problem" with user_names, namely that the local roles 
screen calls it on an unwrapped user folder. Depending on how you use 
SUF, this may be an issue for you. The sql methods (and probably even 
the db connection) should live inside of the SUF and not expected to be 
acquireable from "above".

Alternativley, here is a small patch to Role.py which will rewrap the 
user folder before calling user_names on it.

--- Role.py     Thu Oct 17 19:14:50 2002
+++ Role.py     Thu Oct 17 19:37:35 2002
@@ -312,6 +312,7 @@
                  if mlu < 0: raise OverflowError
                  un = getattr(aclu, 'user_names', _notfound)
                  if un is not _notfound:
+                    un = aclu.__of__(item).user_names   # rewrap
                      unl = un()
                      # maxlistusers of 0 is list all
                      if len(unl) > mlu and mlu != 0:

hth,
Stefan


On Freitag, Nov 14, 2003, at 17:56 Europe/Vienna, emf wrote:

> Having discovered that I can't seem to assign local roles when using a 
> SimpleUserFolder, I'm trying to do whatever it takes for it to work.
>
> The problem is that users in the simple user folder don't show up in 
> the list to be assigned roles.
>

--
The time has come to start talking about whether the emperor is as well
dressed as we are supposed to think he is.               /Pete McBreen/




More information about the Zope mailing list