Merge commit '5f8225360a1f322d2522171edc04aa7a54da41b3' into feature/RM-3300_mergeToMaster

This commit is contained in:
Roxana Lucanu-Ghetu
2016-06-28 11:39:49 +03:00

View File

@@ -154,13 +154,22 @@ public class RecordAspect extends AbstractDisposableItem
kind = BehaviourKind.CLASS,
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT
)
public void onCreateReference(NodeRef fromNodeRef, NodeRef toNodeRef, QName reference)
public void onCreateReference(final NodeRef fromNodeRef, NodeRef toNodeRef, QName reference)
{
// Deal with versioned records
if (reference.equals(CUSTOM_REF_VERSIONS))
{
// Apply the versioned aspect to the from node
// 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