MNT-10404: Runas problem in workflow when package contains versioned content due to versioning ignoring the runas user.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@55164 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Harpritt Kalsi
2013-09-10 09:45:29 +00:00
parent 246a8145ad
commit 186b7f3431

View File

@@ -532,8 +532,20 @@ public class VersionableAspect implements ContentServicePolicies.OnContentUpdate
*/ */
private void createVersionImpl(NodeRef nodeRef, Map<String, Serializable> versionProperties) private void createVersionImpl(NodeRef nodeRef, Map<String, Serializable> versionProperties)
{ {
recordCreateVersion(nodeRef, null); final VersionService vs = this.versionService;
this.versionService.createVersion(nodeRef, versionProperties); final NodeRef nf = nodeRef;
final Map<String, Serializable> vp = versionProperties;
AuthenticationUtil.runAs(new RunAsWork<Void>() {
@Override
public Void doWork() throws Exception {
recordCreateVersion(nf, null);
vs.createVersion(nf, vp);
return null;
}
},AuthenticationUtil.getRunAsUser());
} }
/** /**