Merge branch 'feature-2.4/RM-3300' into 'release/V2.4'

Feature 2.4/rm 3300

Run code as system

See merge request !265
This commit is contained in:
Roxana Lucanu-Ghetu
2016-06-24 14:46:38 +01:00

View File

@@ -159,8 +159,17 @@ public class RecordAspect extends AbstractDisposableItem
// Deal with versioned records
if (reference.equals(CUSTOM_REF_VERSIONS))
{
// Apply the versioned aspect to the from node
nodeService.addAspect(fromNodeRef, ASPECT_VERSIONED_RECORD, null);
// run as system, to apply the versioned aspect to the from node
// as we can't be sure if the user has add aspect rights
authenticationUtil.runAsSystem(new RunAsWork<Void>()
{
@Override
public Void doWork() throws Exception
{
nodeService.addAspect(fromNodeRef, ASPECT_VERSIONED_RECORD, null);
return null;
}
});
}
// Execute script if for the reference event