mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Fix for ALF-10559 - unable to save/edit user dashboards since Site (st:sites) folder permission changes.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30842 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -326,13 +326,41 @@ public class ADMRemoteStore extends BaseRemoteStore
|
|||||||
final int off = encpath.lastIndexOf('/');
|
final int off = encpath.lastIndexOf('/');
|
||||||
if (off != -1)
|
if (off != -1)
|
||||||
{
|
{
|
||||||
FileInfo parentFolder = resolveNodePath(encpath, true, false);
|
// check we actually are the user we are creating a user specific path for
|
||||||
FileInfo fileInfo = this.fileFolderService.create(
|
String runAsUser = AuthenticationUtil.getFullyAuthenticatedUser();
|
||||||
parentFolder.getNodeRef(), encpath.substring(off + 1), ContentModel.TYPE_CONTENT);
|
String userId = null;
|
||||||
this.contentService.getWriter(
|
Matcher matcher;
|
||||||
fileInfo.getNodeRef(), ContentModel.PROP_CONTENT, true).putContent(content);
|
if ((matcher = USER_PATTERN_1.matcher(path)).matches())
|
||||||
if (logger.isDebugEnabled())
|
{
|
||||||
logger.debug("createDocument: " + fileInfo.toString());
|
userId = matcher.group(1);
|
||||||
|
}
|
||||||
|
else if ((matcher = USER_PATTERN_2.matcher(path)).matches())
|
||||||
|
{
|
||||||
|
userId = matcher.group(1);
|
||||||
|
}
|
||||||
|
if (userId != null && userId.equals(runAsUser))
|
||||||
|
{
|
||||||
|
runAsUser = AuthenticationUtil.getSystemUserName();
|
||||||
|
}
|
||||||
|
AuthenticationUtil.runAs(new RunAsWork<Void>()
|
||||||
|
{
|
||||||
|
@SuppressWarnings("synthetic-access")
|
||||||
|
public Void doWork() throws Exception
|
||||||
|
{
|
||||||
|
final FileInfo parentFolder = resolveNodePath(encpath, true, false);
|
||||||
|
if (parentFolder == null)
|
||||||
|
{
|
||||||
|
throw new IllegalStateException("Unable to aquire parent folder reference for path: " + path);
|
||||||
|
}
|
||||||
|
FileInfo fileInfo = fileFolderService.create(
|
||||||
|
parentFolder.getNodeRef(), encpath.substring(off + 1), ContentModel.TYPE_CONTENT);
|
||||||
|
contentService.getWriter(
|
||||||
|
fileInfo.getNodeRef(), ContentModel.PROP_CONTENT, true).putContent(content);
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
logger.debug("createDocument: " + fileInfo.toString());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}, runAsUser);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (AccessDeniedException ae)
|
catch (AccessDeniedException ae)
|
||||||
@@ -592,6 +620,7 @@ public class ADMRemoteStore extends BaseRemoteStore
|
|||||||
{
|
{
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Resolving path: " + path);
|
logger.debug("Resolving path: " + path);
|
||||||
|
|
||||||
FileInfo result = null;
|
FileInfo result = null;
|
||||||
if (path != null)
|
if (path != null)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user