- Asynchronous rules are now executed as the user that triggers the rule.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2349 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2006-02-11 20:50:05 +00:00
parent 681960a849
commit c4a4e7ecba
5 changed files with 85 additions and 88 deletions

View File

@@ -103,22 +103,9 @@ public abstract class RuleTriggerAbstractBase implements RuleTrigger
*/
protected void triggerRules(NodeRef nodeRef, NodeRef actionedUponNodeRef)
{
String userName = authenticationComponent.getCurrentUserName();
authenticationComponent.setSystemUserAsCurrentUser();
try
for (RuleType ruleType : this.ruleTypes)
{
for (RuleType ruleType : this.ruleTypes)
{
ruleType.triggerRuleType(nodeRef, actionedUponNodeRef);
}
}
finally
{
authenticationComponent.clearCurrentSecurityContext();
if(userName != null)
{
authenticationComponent.setCurrentUser(userName);
}
ruleType.triggerRuleType(nodeRef, actionedUponNodeRef);
}
}
}