[Zope-Checkins] CVS: Zope/lib/python/OFS - CopySupport.py:1.84

Andreas Jung andreas@andreas-jung.com
Sun, 2 Feb 2003 08:46:29 -0500


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

Modified Files:
	CopySupport.py 
Log Message:
- Locked objects can not be CUT
- Pasted objects are copied without WebDAV locks


=== Zope/lib/python/OFS/CopySupport.py 1.83 => 1.84 ===
--- Zope/lib/python/OFS/CopySupport.py:1.83	Wed Dec 18 07:03:43 2002
+++ Zope/lib/python/OFS/CopySupport.py	Sun Feb  2 08:46:27 2003
@@ -22,6 +22,7 @@
 from Acquisition import aq_base, aq_inner, aq_parent
 from zExceptions import Unauthorized
 from AccessControl import getSecurityManager
+from webdav.Lockable import ResourceLockedError
 
 CopyError='Copy Error'
 
@@ -65,6 +66,10 @@
         oblist=[]
         for id in ids:
             ob=self._getOb(id)
+
+            if ob.wl_isLocked():
+                raise ResourceLockedError, 'Object "%s" is locked via WebDAV' % ob.getId()
+
             if not ob.cb_isMoveable():
                 raise CopyError, eNotSupported % id
             m=Moniker.Moniker(ob)
@@ -164,6 +169,7 @@
                 self._setObject(id, ob)
                 ob = self._getOb(id)
                 ob.manage_afterClone(ob)
+                ob.wl_clearLocks()
 
             if REQUEST is not None:
                 return self.manage_main(self, REQUEST, update_menu=1,