Merge release/2.4 into master

This commit is contained in:
Ana Bozianu
2016-02-22 16:16:38 +02:00
parent 573b9e3b9f
commit 156fc5b48e

View File

@@ -228,24 +228,33 @@ public class ExtendedRuleServiceImpl extends RuleServiceImpl
* @param typeQName
* @return
*/
private boolean shouldRuleBeAppliedToNode(Rule rule, NodeRef nodeRef, QName typeQName)
private boolean shouldRuleBeAppliedToNode(final Rule rule, final NodeRef nodeRef, final QName typeQName)
{
return AuthenticationUtil.runAsSystem(new RunAsWork<Boolean>()
{
public Boolean doWork() throws Exception
{
boolean result = true;
NodeRef ruleNodeRef = getOwningNodeRef(rule);
if(filePlanService.isFilePlan(ruleNodeRef))
if (filePlanService.isFilePlan(ruleNodeRef))
{
// if this rule is defined at the root of the file plan then we do not want to apply
// if this rule is defined at the root of the file plan then
// we do not want to apply
// it to holds/transfers/unfiled content...
result = !(RecordsManagementModel.TYPE_HOLD.equals(typeQName) ||
RecordsManagementModel.TYPE_HOLD_CONTAINER.equals(typeQName) ||
RecordsManagementModel.TYPE_TRANSFER.equals(typeQName) ||
RecordsManagementModel.TYPE_TRANSFER_CONTAINER.equals(typeQName) ||
RecordsManagementModel.TYPE_UNFILED_RECORD_CONTAINER.equals(typeQName) ||
RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER.equals(typeQName) ||
nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_TRANSFERRING) ||
nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_FROZEN) ||
!recordService.isFiled(nodeRef));
result = !(RecordsManagementModel.TYPE_HOLD.equals(typeQName)
|| RecordsManagementModel.TYPE_HOLD_CONTAINER.equals(typeQName)
|| RecordsManagementModel.TYPE_TRANSFER.equals(typeQName)
|| RecordsManagementModel.TYPE_TRANSFER_CONTAINER.equals(typeQName)
|| RecordsManagementModel.TYPE_UNFILED_RECORD_CONTAINER
.equals(typeQName)
|| RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER.equals(typeQName)
|| nodeService.hasAspect(nodeRef,
RecordsManagementModel.ASPECT_TRANSFERRING)
|| nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_FROZEN)
|| !recordService.isFiled(nodeRef));
}
return result;
}
});
}
}