RM-1297 (Access denied if file a record to Unfiled Records where inbound File to rule is set)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@63561 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-03-03 21:58:56 +00:00
parent 8f18f765d3
commit f07539e5e1

View File

@@ -8,6 +8,8 @@ import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
import org.alfresco.repo.action.ParameterDefinitionImpl;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
@@ -93,14 +95,24 @@ public class FileToAction extends RMActionExecuterAbstractBase
if (recordFolderService.isRecordFolder(recordFolder) == true)
{
final NodeRef finalRecordFolder = recordFolder;
try
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
fileFolderService.move(actionedUponNodeRef, finalRecordFolder, null);
}
catch (FileNotFoundException fileNotFound)
{
throw new AlfrescoRuntimeException("Unable to execute file to action, because the move operation failed.", fileNotFound);
}
@Override
public Void doWork() throws Exception
{
try
{
fileFolderService.move(actionedUponNodeRef, finalRecordFolder, null);
}
catch (FileNotFoundException fileNotFound)
{
throw new AlfrescoRuntimeException("Unable to execute file to action, because the move operation failed.", fileNotFound);
}
return null;
}
});
}
else
{