ACE-5647: [Win7,chrome] Configure dashboard - Configuration not saved after removing dashlets to trashcan

-Run the deleteDocument action as pathRunAsUser (system for non-admin users) same as is done for updateDocument and createDocument.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@133350 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ramona Neamtu
2016-12-06 15:07:50 +00:00
parent bf47206dab
commit cc24b21c78

View File

@@ -625,33 +625,43 @@ public class ADMRemoteStore extends BaseRemoteStore
res.setStatus(Status.STATUS_NOT_FOUND); res.setStatus(Status.STATUS_NOT_FOUND);
return; return;
} }
try final String runAsUser = getPathRunAsUser(path);
{ AuthenticationUtil.runAs(new RunAsWork<Void>()
final NodeRef fileRef = fileInfo.getNodeRef(); {
this.nodeService.addAspect(fileRef, ContentModel.ASPECT_TEMPORARY, null); @SuppressWarnings("synthetic-access")
public Void doWork() throws Exception
// ALF-17729 {
NodeRef parentFolderRef = unprotNodeService.getPrimaryParent(fileRef).getParentRef(); try
behaviourFilter.disableBehaviour(parentFolderRef, ContentModel.ASPECT_AUDITABLE); {
final NodeRef fileRef = fileInfo.getNodeRef();
try // MNT-16371: Revoke ownership privileges for surf-config folder contents, to tighten access for former SiteManagers.
{ nodeService.addAspect(fileRef, ContentModel.ASPECT_TEMPORARY, null);
this.nodeService.deleteNode(fileRef);
} // ALF-17729
finally NodeRef parentFolderRef = unprotNodeService.getPrimaryParent(fileRef).getParentRef();
{ behaviourFilter.disableBehaviour(parentFolderRef, ContentModel.ASPECT_AUDITABLE);
behaviourFilter.enableBehaviour(parentFolderRef, ContentModel.ASPECT_AUDITABLE);
} try
{
if (logger.isDebugEnabled()) nodeService.deleteNode(fileRef);
logger.debug("deleteDocument: " + fileInfo.toString()); }
} finally
catch (AccessDeniedException ae) {
{ behaviourFilter.enableBehaviour(parentFolderRef, ContentModel.ASPECT_AUDITABLE);
res.setStatus(Status.STATUS_UNAUTHORIZED); }
throw ae;
} if (logger.isDebugEnabled())
logger.debug("deleteDocument: " + fileInfo.toString());
}
catch (AccessDeniedException ae)
{
res.setStatus(Status.STATUS_UNAUTHORIZED);
throw ae;
}
return null;
}
}, runAsUser);
} }
/** /**