[Zope-Checkins] CVS: Zope/lib/python/AccessControl -
Owned.py:1.18.6.3
Brian Lloyd
brian at zope.com
Thu Jan 29 14:31:16 EST 2004
Update of /cvs-repository/Zope/lib/python/AccessControl
In directory cvs.zope.org:/tmp/cvs-serv31162/lib/python/AccessControl
Modified Files:
Tag: Zope-2_6-branch
Owned.py
Log Message:
fix inadvertant getOwner result change
=== Zope/lib/python/AccessControl/Owned.py 1.18.6.2 => 1.18.6.3 ===
--- Zope/lib/python/AccessControl/Owned.py:1.18.6.2 Mon Jan 26 13:15:41 2004
+++ Zope/lib/python/AccessControl/Owned.py Thu Jan 29 14:31:15 2004
@@ -62,7 +62,11 @@
return d
getOwner__roles__=()
- def getOwner(self, info=0):
+ def getOwner(self, info=0,
+ aq_get=aq_get, None=None,
+ UnownableOwner=UnownableOwner,
+ getSecurityManager=getSecurityManager,
+ ):
"""Get the owner
If a true argument is provided, then only the owner path and id are
@@ -74,9 +78,22 @@
'please use getOwnerTuple() instead.',
DeprecationWarning)
- return self.getOwnerTuple()
- return aq_base(self.getWrappedOwner()) # ugh, backward compat.
+ owner=aq_get(self, '_owner', None, 1)
+ if info or (owner is None): return owner
+
+ if owner is UnownableOwner: return None
+
+ udb, oid = owner
+
+ root=self.getPhysicalRoot()
+ udb=root.unrestrictedTraverse(udb, None)
+ if udb is None:
+ user = SpecialUsers.nobody
+ else:
+ user = udb.getUserById(oid, None)
+ if user is None: user = SpecialUsers.nobody
+ return user
getOwnerTuple__roles__=()
def getOwnerTuple(self):
More information about the Zope-Checkins
mailing list