RM-756 (Rule do not fire within collaboration site)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@52069 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2013-07-03 13:14:59 +00:00
parent 40db3b7787
commit c914e2f02e

View File

@@ -95,27 +95,25 @@ public class ExtendedRuleServiceImpl extends RuleServiceImpl
// The dispositionSchedule node will not be executed by rules
if (recordsManagementService.isFilePlanComponent(nodeRef) == true
&& typeQName.equals(RecordsManagementModel.TYPE_DISPOSITION_SCHEDULE) == false)
&& typeQName.equals(RecordsManagementModel.TYPE_DISPOSITION_SCHEDULE) == false
&& isFilePlanComponentRule(rule) == true && runAsRmAdmin == true)
{
if (isFilePlanComponentRule(rule) == true && runAsRmAdmin == true)
String user = AuthenticationUtil.getFullyAuthenticatedUser();
try
{
String user = AuthenticationUtil.getFullyAuthenticatedUser();
try
{
AuthenticationUtil.setFullyAuthenticatedUser(filePlanAuthenticationService.getRmAdminUserName());
ExtendedRuleServiceImpl.super.executeRule(rule, nodeRef, executedRules);
}
finally
{
AuthenticationUtil.setFullyAuthenticatedUser(user);
}
AuthenticationUtil.setFullyAuthenticatedUser(filePlanAuthenticationService.getRmAdminUserName());
ExtendedRuleServiceImpl.super.executeRule(rule, nodeRef, executedRules);
}
else
finally
{
// just execute the rule as the current user
super.executeRule(rule, nodeRef, executedRules);
AuthenticationUtil.setFullyAuthenticatedUser(user);
}
}
else
{
// just execute the rule as the current user
super.executeRule(rule, nodeRef, executedRules);
}
}
private boolean isFilePlanComponentRule(Rule rule)