mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge commit '5f8225360a1f322d2522171edc04aa7a54da41b3' into feature/RM-3300_mergeToMaster
This commit is contained in:
@@ -154,13 +154,22 @@ public class RecordAspect extends AbstractDisposableItem
|
|||||||
kind = BehaviourKind.CLASS,
|
kind = BehaviourKind.CLASS,
|
||||||
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT
|
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
|
// Deal with versioned records
|
||||||
if (reference.equals(CUSTOM_REF_VERSIONS))
|
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);
|
nodeService.addAspect(fromNodeRef, ASPECT_VERSIONED_RECORD, null);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute script if for the reference event
|
// Execute script if for the reference event
|
||||||
|
Reference in New Issue
Block a user