[Zope-Checkins] CVS: Zope/lib/python/OFS - PropertySheets.py:1.81

Andreas Jung andreas@digicool.com
Wed, 9 Jan 2002 13:38:12 -0500


Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv23191/OFS

Modified Files:
	PropertySheets.py 
Log Message:
Collector #126: merge from 2.5 branch fixes LOCK-stealing problem
with cadaver


=== Zope/lib/python/OFS/PropertySheets.py 1.80 => 1.81 ===
 from Traversable import Traversable
 from Acquisition import aq_base
+from AccessControl import getSecurityManager
 
 class View(App.Management.Tabs, Base):
     """A view of an object, typically used for management purposes
@@ -541,13 +542,24 @@
                '  </n:lockentry>\n  '
 
     def dav__lockdiscovery(self):
+        security = getSecurityManager()
+        user = security.getUser().getUserName()
+        
+
         vself = self.v_self()
         out = '\n'
         if WriteLockInterface.isImplementedBy(vself):
             locks = vself.wl_lockValues(killinvalids=1)
             for lock in locks:
-                out = '%s\n%s' % (out, lock.asLockDiscoveryProperty('n'))
+
+                creator = lock.getCreator()[-1]
+                if creator == user: fake=0
+                else:               fake=1
+                    
+                out = '%s\n%s' % (out, lock.asLockDiscoveryProperty('n',fake=fake))
+                
             out = '%s\n' % out
+
         return out