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

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