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