Commit 2938714a authored by Andreas Jung's avatar Andreas Jung

deleting objects is now handled through manage_delObjects()

(Collector #2196)
parent 64c8b915
......@@ -85,7 +85,7 @@
"""WebDAV support - collection objects."""
__version__='$Revision: 1.19 $'[11:-2]
__version__='$Revision: 1.20 $'[11:-2]
import sys, os, string, Globals, davcmds, Lockable,re
from common import urlfix, rfc1123_date
......@@ -154,10 +154,10 @@ class Collection(Resource):
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 @@ class Collection(Resource):
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
......
......@@ -85,7 +85,7 @@
"""WebDAV support - resource objects."""
__version__='$Revision: 1.43 $'[11:-2]
__version__='$Revision: 1.44 $'[11:-2]
import sys, os, string, mimetypes, davcmds, ExtensionClass, Lockable
from common import absattr, aq_base, urlfix, rfc1123_date, tokenFinder, urlbase
......@@ -294,8 +294,13 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem):
'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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment