mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
60016: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (Cloud/4.3) 59975: MNT-10380: (WebDAV) access denied when attempting to rename file should result in error message. Previously fixed for same issue (was ALF-14398) but lost (most likely during a large merge). git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62253 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -248,36 +248,20 @@ public class MoveMethod extends HierarchicalMethod
|
||||
else if (sourceParentNodeRef.equals(destParentNodeRef))
|
||||
{
|
||||
// It is a simple rename operation
|
||||
try
|
||||
// MNT-9939 - check overwrite
|
||||
if (hasOverWrite() && destFileInfo != null && !sourceFileInfo.equals(destFileInfo))
|
||||
{
|
||||
// MNT-9939 - check overwrite
|
||||
if (hasOverWrite() && destFileInfo != null && !sourceFileInfo.equals(destFileInfo))
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Destination exists and overwrite is allowed");
|
||||
}
|
||||
|
||||
fileFolderService.delete(destFileInfo.getNodeRef());
|
||||
logger.debug("Destination exists and overwrite is allowed");
|
||||
}
|
||||
|
||||
fileFolderService.rename(sourceNodeRef, name);
|
||||
// As per the WebDAV spec, we make sure the node is unlocked once moved
|
||||
getDAVHelper().getLockService().unlock(sourceNodeRef);
|
||||
}
|
||||
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);
|
||||
fileFolderService.delete(destFileInfo.getNodeRef());
|
||||
}
|
||||
|
||||
fileFolderService.rename(sourceNodeRef, name);
|
||||
// As per the WebDAV spec, we make sure the node is unlocked once moved
|
||||
getDAVHelper().getLockService().unlock(sourceNodeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user