RM-5012 - run on add record policy as system

This commit is contained in:
Ana Bozianu
2017-05-23 11:02:08 +03:00
parent 232c42be6c
commit bd2fdca906

View File

@@ -433,11 +433,19 @@ public class RecordServiceImpl extends BaseBehaviourBean
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT
) )
public void onAddAspect(NodeRef nodeRef, QName aspect) public void onAddAspect(NodeRef nodeRef, QName aspect)
{
authenticationUtil.runAsSystem(new RunAsWork<Void>()
{
@Override
public Void doWork() throws Exception
{ {
if (nodeService.exists(nodeRef) && nodeService.hasAspect(nodeRef, ASPECT_RECORD)) if (nodeService.exists(nodeRef) && nodeService.hasAspect(nodeRef, ASPECT_RECORD))
{ {
generateRecordIdentifier(nodeService, identifierService, nodeRef); generateRecordIdentifier(nodeService, identifierService, nodeRef);
} }
return null;
}
});
} }
/** /**