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 @@ ...@@ -85,7 +85,7 @@
"""WebDAV support - collection objects.""" """WebDAV support - collection objects."""
__version__='$Revision: 1.19 $'[11:-2] __version__='$Revision: 1.20 $'[11:-2]
import sys, os, string, Globals, davcmds, Lockable,re import sys, os, string, Globals, davcmds, Lockable,re
from common import urlfix, rfc1123_date from common import urlfix, rfc1123_date
...@@ -154,10 +154,10 @@ class Collection(Resource): ...@@ -154,10 +154,10 @@ class Collection(Resource):
user = getSecurityManager().getUser() user = getSecurityManager().getUser()
token = None token = None
if re.match("/Control_Panel",REQUEST['PATH_INFO']): # if re.match("/Control_Panel",REQUEST['PATH_INFO']):
RESPONSE.setStatus(403) # RESPONSE.setStatus(403)
RESPONSE.setHeader('Content-Type', 'text/xml; charset="utf-8"') # RESPONSE.setHeader('Content-Type', 'text/xml; charset="utf-8"')
return RESPONSE # return RESPONSE
# Level 1 of lock checking (is the collection or its parent locked?) # Level 1 of lock checking (is the collection or its parent locked?)
if Lockable.wl_isLocked(self): if Lockable.wl_isLocked(self):
...@@ -190,8 +190,13 @@ class Collection(Resource): ...@@ -190,8 +190,13 @@ class Collection(Resource):
RESPONSE.setBody(result) RESPONSE.setBody(result)
else: else:
# There were no conflicts, so we can go ahead and delete # There were no conflicts, so we can go ahead and delete
self.aq_parent._delObject(name) # ajung: additional check if we really could delete the collection
RESPONSE.setStatus(204) # (Collector #2196)
if parent.manage_delObjects([name],REQUEST=None) is None:
RESPONSE.setStatus(204)
else:
RESPONSE.setStatus(403)
return RESPONSE return RESPONSE
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
"""WebDAV support - resource objects.""" """WebDAV support - resource objects."""
__version__='$Revision: 1.43 $'[11:-2] __version__='$Revision: 1.44 $'[11:-2]
import sys, os, string, mimetypes, davcmds, ExtensionClass, Lockable import sys, os, string, mimetypes, davcmds, ExtensionClass, Lockable
from common import absattr, aq_base, urlfix, rfc1123_date, tokenFinder, urlbase from common import absattr, aq_base, urlfix, rfc1123_date, tokenFinder, urlbase
...@@ -294,8 +294,13 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem): ...@@ -294,8 +294,13 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem):
'condition was passed in.' 'condition was passed in.'
# Either we're not locked, or a succesful lock token was submitted # Either we're not locked, or a succesful lock token was submitted
# so we can delete the lock now. # so we can delete the lock now.
self.aq_parent._delObject(name) # ajung: Fix for Collector # 2196
RESPONSE.setStatus(204)
if parent.manage_delObjects([name],REQUEST=None) is None:
RESPONSE.setStatus(204)
else:
RESPONSE.setStatus(403)
return RESPONSE return RESPONSE
def PROPFIND(self, REQUEST, 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