[Zope-Checkins] CVS: Zope/lib/python/AccessControl - Owned.py:1.17
Shane Hathaway
shane@cvs.zope.org
Wed, 12 Jun 2002 14:14:39 -0400
Update of /cvs-repository/Zope/lib/python/AccessControl
In directory cvs.zope.org:/tmp/cvs-serv19833
Modified Files:
Owned.py
Log Message:
User folders might have an id() method rather than a string-valued "id"
attribute. The ownership code must take this into account.
=== Zope/lib/python/AccessControl/Owned.py 1.16 => 1.17 ===
+def absattr(attr):
+ if callable(attr): return attr()
+ return attr
+
def ownerInfo(user,
getattr=getattr, type=type, st=type(''), None=None):
if user is None:
@@ -233,7 +237,7 @@
uid=user.getId()
if uid is None: return uid
db=user.aq_inner.aq_parent
- path=[db.id]
+ path=[absattr(db.id)]
root=db.getPhysicalRoot()
while 1:
db=getattr(db,'aq_inner', None)