Fix for CLOUD-2151 - Changing the theme for the alfresco.com network on production does not take effect for all users

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@57263 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2013-10-28 14:47:21 +00:00
parent a1651c876a
commit 454adacee2

View File

@@ -546,26 +546,35 @@ public class ADMRemoteStore extends BaseRemoteStore
@Override
protected void updateDocument(final WebScriptResponse res, String store, final String path, final InputStream content)
{
final String encpath = encodePath(path);
final FileInfo fileInfo = resolveFilePath(encpath);
if (fileInfo == null || fileInfo.isFolder())
final String runAsUser = getPathRunAsUser(path);
AuthenticationUtil.runAs(new RunAsWork<Void>()
{
res.setStatus(Status.STATUS_NOT_FOUND);
return;
}
try
{
ContentWriter writer = contentService.getWriter(fileInfo.getNodeRef(), ContentModel.PROP_CONTENT, true);
writer.putContent(content);
if (logger.isDebugEnabled())
logger.debug("updateDocument: " + fileInfo.toString());
}
catch (AccessDeniedException ae)
{
res.setStatus(Status.STATUS_UNAUTHORIZED);
throw ae;
}
@SuppressWarnings("synthetic-access")
public Void doWork() throws Exception
{
final String encpath = encodePath(path);
final FileInfo fileInfo = resolveFilePath(encpath);
if (fileInfo == null || fileInfo.isFolder())
{
res.setStatus(Status.STATUS_NOT_FOUND);
return null;
}
try
{
ContentWriter writer = contentService.getWriter(fileInfo.getNodeRef(), ContentModel.PROP_CONTENT, true);
writer.putContent(content);
if (logger.isDebugEnabled())
logger.debug("updateDocument: " + fileInfo.toString());
}
catch (AccessDeniedException ae)
{
res.setStatus(Status.STATUS_UNAUTHORIZED);
throw ae;
}
return null;
}
}, runAsUser);
}
/**