ALF-9937: Alfresco Share Icon on a folder that designates a rule

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32040 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2011-11-17 02:34:28 +00:00
parent a16fd2d139
commit 4a73cf915b

View File

@@ -913,6 +913,18 @@ public class RuleServiceImpl
// If this was the last rule on the node, remove the aspect
if(countRules(nodeRef) == 0)
{
// Since this is the last rule, unlink any linked rulesets
List<NodeRef> linkedFrom = getLinkedFromRuleNodes(nodeRef);
if (linkedFrom.isEmpty() == false)
{
for (NodeRef linkedFromNodeRef : linkedFrom)
{
NodeRef ruleFolder = getSavedRuleFolderAssoc(nodeRef).getChildRef();
nodeService.removeChild(linkedFromNodeRef, ruleFolder);
nodeService.removeAspect(linkedFromNodeRef, RuleModel.ASPECT_RULES);
}
}
this.nodeService.removeAspect(nodeRef, RuleModel.ASPECT_RULES);
}
}