[Zope-Checkins] CVS: Zope2 - Collection.py:1.20 Resource.py:1.44
andreas@serenade.digicool.com
andreas@serenade.digicool.com
Tue, 1 May 2001 10:41:05 -0400
Update of /cvs-repository/Zope2/lib/python/webdav
In directory serenade.digicool.com:/tmp/cvs-serv12813
Modified Files:
Collection.py Resource.py
Log Message:
deleting objects is now handled through manage_delObjects()
(Collector #2196)
--- Updated File Collection.py in package Zope2 --
--- Collection.py 2001/04/30 16:47:30 1.19
+++ Collection.py 2001/05/01 14:41:04 1.20
@@ -154,10 +154,10 @@
user = getSecurityManager().getUser()
token = None
- if re.match("/Control_Panel",REQUEST['PATH_INFO']):
- RESPONSE.setStatus(403)
- RESPONSE.setHeader('Content-Type', 'text/xml; charset="utf-8"')
- return RESPONSE
+# if re.match("/Control_Panel",REQUEST['PATH_INFO']):
+# RESPONSE.setStatus(403)
+# RESPONSE.setHeader('Content-Type', 'text/xml; charset="utf-8"')
+# return RESPONSE
# Level 1 of lock checking (is the collection or its parent locked?)
if Lockable.wl_isLocked(self):
@@ -190,8 +190,13 @@
RESPONSE.setBody(result)
else:
# There were no conflicts, so we can go ahead and delete
- self.aq_parent._delObject(name)
- RESPONSE.setStatus(204)
+ # ajung: additional check if we really could delete the collection
+ # (Collector #2196)
+ if parent.manage_delObjects([name],REQUEST=None) is None:
+ RESPONSE.setStatus(204)
+ else:
+ RESPONSE.setStatus(403)
+
return RESPONSE
--- Updated File Resource.py in package Zope2 --
--- Resource.py 2001/04/23 15:39:12 1.43
+++ Resource.py 2001/05/01 14:41:04 1.44
@@ -294,8 +294,13 @@
'condition was passed in.'
# Either we're not locked, or a succesful lock token was submitted
# so we can delete the lock now.
- self.aq_parent._delObject(name)
- RESPONSE.setStatus(204)
+ # ajung: Fix for Collector # 2196
+
+ if parent.manage_delObjects([name],REQUEST=None) is None:
+ RESPONSE.setStatus(204)
+ else:
+ RESPONSE.setStatus(403)
+
return RESPONSE
def PROPFIND(self, REQUEST, RESPONSE):