From f9b0cd085d14200f6c2b0bc23dc009a31f061311 Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Wed, 22 Aug 2012 15:36:37 +0000 Subject: [PATCH] ALF-14398: Webdav: Unfriendly behavior when a user without permissions (Contributor/Consumer) tries to rename space/content Removed badly formed response generation. The original code generated a partial XML response that would not have been valid unless it was included in a proper multistatus XML fragment. In addition to this, the XML was not being flushed from the buffer so was not being written to the response anyway. Also, the status code was not applicable (409 CONFLICT) but should have been 403 FORBIDDEN. In addition to these points the XML/status code combination would only have been valid in response to a PROPPATCH request, not a MOVE -- so I have replaced all the response generation with just allowing the AccessDeniedException to propagate, resulting in a 403 FORBIDDEN. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@40741 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/repo/webdav/MoveMethod.java | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/source/java/org/alfresco/repo/webdav/MoveMethod.java b/source/java/org/alfresco/repo/webdav/MoveMethod.java index eec0d7d165..45443d4910 100644 --- a/source/java/org/alfresco/repo/webdav/MoveMethod.java +++ b/source/java/org/alfresco/repo/webdav/MoveMethod.java @@ -113,24 +113,7 @@ public class MoveMethod extends AbstractMoveOrCopyMethod if (sourceParentNodeRef.equals(destParentNodeRef)) { // It is rename method - try - { - fileFolderService.rename(sourceNodeRef, name); - } - catch (AccessDeniedException e) - { - XMLWriter xml = createXMLWriter(); - - Attributes nullAttr = getDAVHelper().getNullAttributes(); - - xml.startElement(WebDAV.DAV_NS, WebDAV.XML_ERROR, WebDAV.XML_NS_ERROR, nullAttr); - // Output error - xml.write(DocumentHelper.createElement(WebDAV.XML_NS_CANNOT_MODIFY_PROTECTED_PROPERTY)); - - xml.endElement(WebDAV.DAV_NS, WebDAV.XML_ERROR, WebDAV.XML_NS_ERROR); - m_response.setStatus(HttpServletResponse.SC_CONFLICT); - return; - } + fileFolderService.rename(sourceNodeRef, name); } else {