Hi, all. 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. It appears to me that the function being called to figure out who can be assigned local roles is get_valid_userids in Roles.py. As far as I can tell this function is applied to every parental folderish object when manage_listLocalRoles is called. This performs two checks; the first is assuming that obj.__allow_groups__ is the acl_user folder, and the second is getting user_names . __allow_groups__ is added by manage_afterAdd in BasicUserFolder (though, in the generic User folder implementation, it's also added in the manage_addUserFolder , so I tried doing the same thing in addSimpleUserFolder to no avail). user_names is defined in BasicUserFolder to be getUserNames , which is defined in SimpleUserFolder. In short, I can't see why I'm getting a truncated list. Can someone help me out here? ~mindlace p.s. i'm not subbed, so please cc: me on replies.
FWIW, I use SUF and just checked the "local roles" list ... (Security tab/local roles) and my USERS show up as expected. David ----- Original Message ----- From: "emf" <i@mindlace.net> To: <zope@zope.org> Sent: Friday, November 14, 2003 8:56 AM Subject: [Zope] SimpleUserFolder and local roles
Hi, all.
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.
It appears to me that the function being called to figure out who can be assigned local roles is get_valid_userids in Roles.py.
As far as I can tell this function is applied to every parental folderish object when manage_listLocalRoles is called.
This performs two checks; the first is assuming that obj.__allow_groups__ is the acl_user folder, and the second is getting user_names .
__allow_groups__ is added by manage_afterAdd in BasicUserFolder (though, in the generic User folder implementation, it's also added in the manage_addUserFolder , so I tried doing the same thing in addSimpleUserFolder to no avail).
user_names is defined in BasicUserFolder to be getUserNames , which is defined in SimpleUserFolder.
In short, I can't see why I'm getting a truncated list. Can someone help me out here?
~mindlace
p.s. i'm not subbed, so please cc: me on replies.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
emf wrote at 2003-11-14 08:56 -0800:
... 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. ... This performs two checks; the first is assuming that obj.__allow_groups__ is the acl_user folder, and the second is getting user_names .
"SimpleUserFolder" must set the "__allow_groups" as it would otherwise be completely useless: "ZPublisher" uses "__allow_groups" for the primary authentication. Therefore, there must be some problem with "user_names". -- Dieter
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/
On Nov 16, 2003, at 9:01 AM, Stefan H. Holek wrote:
Alternativley, here is a small patch to Role.py which will rewrap the user folder before calling user_names on it.
Thanks so much for this; it solved my problem. I appreciate your help. -- Nothing can happen inside a sphere that you could not inscribe upon it. ~mindlace http://mindlace.net
participants (4)
-
David Hassalevris -
Dieter Maurer -
emf -
Stefan H. Holek