mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-16257: CIFS: Collaborator/editor could not edit file on Mac Os Mountain Lion
For DoubleRenameShuffle scenario for Mac Lion files add moveAsSystem flag to allow Editor to edit files. Add unit tests. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@55130 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1337,7 +1337,7 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD
|
||||
* @param newName path/name of new file
|
||||
* @exception java.io.IOException The exception description.
|
||||
*/
|
||||
public void renameFile(NodeRef rootNode, final String oldName, final String newName, boolean soft)
|
||||
public void renameFile(NodeRef rootNode, final String oldName, final String newName, boolean soft, boolean moveAsSystem)
|
||||
throws IOException
|
||||
{
|
||||
|
||||
@@ -1390,7 +1390,25 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD
|
||||
}
|
||||
else
|
||||
{
|
||||
fileFolderService.moveFrom(nodeToMoveRef, sourceFolderRef, targetFolderRef, name);
|
||||
if (moveAsSystem)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Run move as System for: " + oldName);
|
||||
}
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
return fileFolderService.moveFrom(nodeToMoveRef, sourceFolderRef, targetFolderRef, name);
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
}
|
||||
else
|
||||
{
|
||||
fileFolderService.moveFrom(nodeToMoveRef, sourceFolderRef, targetFolderRef, name);
|
||||
}
|
||||
|
||||
logger.debug(
|
||||
"Moved between different folders: \n" +
|
||||
" Old name: " + oldName + "\n" +
|
||||
|
Reference in New Issue
Block a user