def UNLOCK(self, REQUEST, RESPONSE): """ Unlocking a Null Resource removes it from its parent """ self.dav__init(REQUEST, RESPONSE) security = getSecurityManager() user = security.getUser() token = REQUEST.get_header('Lock-Token', '') url = REQUEST['URL'] if token: token = tokenFinder(token) else: raise BadRequest, 'No lock token was submitted in the request' cmd = Unlock() result = cmd.apply(self, token, url) parent = aq_parent(self) parent._delObject(self.id) if result: RESPONSE.setStatus(207) RESPONSE.setHeader('Content-Type', 'text/xml; charset="utf-8"') RESPONSE.setBody(result) else: RESPONSE.setStatus(204) return RESPONSE
def UNLOCK(self, REQUEST, RESPONSE): """Remove an existing lock on a resource.""" from webdav.davcmds import Unlock self.dav__init(REQUEST, RESPONSE) token = REQUEST.get_header('Lock-Token', '') url = REQUEST['URL'] token = tokenFinder(token) cmd = Unlock() result = cmd.apply(self, token, url) if result: RESPONSE.setStatus(207) RESPONSE.setHeader('Content-Type', 'text/xml; charset="utf-8"') RESPONSE.setBody(result) else: RESPONSE.setStatus(204) # No Content response code return RESPONSE