mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge release/V2.4 into master
This commit is contained in:
@@ -1446,7 +1446,11 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
|
|||||||
if (entry.getEvent().equals("Create Person") && entry.getNodeRef() != null)
|
if (entry.getEvent().equals("Create Person") && entry.getNodeRef() != null)
|
||||||
{
|
{
|
||||||
NodeRef nodeRef = entry.getNodeRef();
|
NodeRef nodeRef = entry.getNodeRef();
|
||||||
String userName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME);
|
String userName = null;
|
||||||
|
if(nodeService.exists(nodeRef))
|
||||||
|
{
|
||||||
|
userName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME);
|
||||||
|
}
|
||||||
json.put("nodeName", userName == null ? "": userName);
|
json.put("nodeName", userName == null ? "": userName);
|
||||||
json.put("createPerson", true);
|
json.put("createPerson", true);
|
||||||
}
|
}
|
||||||
|
@@ -269,7 +269,7 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
|
|||||||
* @param form
|
* @param form
|
||||||
* @param nodeRef
|
* @param nodeRef
|
||||||
*/
|
*/
|
||||||
protected void addTransientProperties(Form form, final NodeRef nodeRef)
|
protected void addTransientProperties(final Form form, final NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
if (recordService.isRecord(nodeRef))
|
if (recordService.isRecord(nodeRef))
|
||||||
{
|
{
|
||||||
@@ -277,33 +277,36 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Need to get the disposition schedule as the system user. See RM-1727.
|
// Need to get the disposition schedule as the system user. See RM-1727.
|
||||||
DispositionSchedule ds = runAsSystem(new RunAsWork<DispositionSchedule>()
|
//Need to run all block as the system user, needed for disposition instructions, recordCategory and categoryId. See RM-3077.
|
||||||
|
runAsSystem(new RunAsWork<Void>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public DispositionSchedule doWork()
|
public Void doWork() throws Exception
|
||||||
{
|
{
|
||||||
return getDispositionService().getDispositionSchedule(nodeRef);
|
DispositionSchedule ds = getDispositionService().getDispositionSchedule(nodeRef);
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (ds != null)
|
if (ds != null)
|
||||||
{
|
{
|
||||||
String instructions = ds.getDispositionInstructions();
|
String instructions = ds.getDispositionInstructions();
|
||||||
if (instructions != null)
|
if (instructions != null)
|
||||||
{
|
{
|
||||||
addTransientPropertyField(form, TRANSIENT_DISPOSITION_INSTRUCTIONS, DataTypeDefinition.TEXT, instructions);
|
addTransientPropertyField(form, TRANSIENT_DISPOSITION_INSTRUCTIONS, DataTypeDefinition.TEXT,
|
||||||
|
instructions);
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeRef recordCategory = getDispositionService().getAssociatedRecordsManagementContainer(ds);
|
NodeRef recordCategory = getDispositionService().getAssociatedRecordsManagementContainer(ds);
|
||||||
if (recordCategory != null)
|
if (recordCategory != null)
|
||||||
{
|
{
|
||||||
String categoryId = (String)nodeService.getProperty(recordCategory, PROP_IDENTIFIER);
|
String categoryId = (String) nodeService.getProperty(recordCategory, PROP_IDENTIFIER);
|
||||||
if (categoryId != null)
|
if (categoryId != null)
|
||||||
{
|
{
|
||||||
addTransientPropertyField(form, TRANSIENT_CATEGORY_ID, DataTypeDefinition.TEXT, categoryId);
|
addTransientPropertyField(form, TRANSIENT_CATEGORY_ID, DataTypeDefinition.TEXT, categoryId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -158,6 +158,10 @@ public class AuditLogGet extends BaseAuditRetrievalWebScript
|
|||||||
if( targetNode == null )
|
if( targetNode == null )
|
||||||
{
|
{
|
||||||
targetNode = filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
|
targetNode = filePlanService.getFilePlanBySiteId(FilePlanService.DEFAULT_RM_SITE_ID);
|
||||||
|
if(targetNode == null)
|
||||||
|
{
|
||||||
|
throw new WebScriptException(Status.STATUS_NOT_FOUND, "The default RM site was not found");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return AccessStatus.ALLOWED.equals(
|
return AccessStatus.ALLOWED.equals(
|
||||||
capabilityService.getCapabilityAccessState(targetNode, ACCESS_AUDIT_CAPABILITY));
|
capabilityService.getCapabilityAccessState(targetNode, ACCESS_AUDIT_CAPABILITY));
|
||||||
|
Reference in New Issue
Block a user