From: <cl...@hy...> - 2009-02-27 05:33:03
|
Author: clee Date: 2009-02-26 21:32:56 -0800 (Thu, 26 Feb 2009) New Revision: 12631 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=12631 Modified: branches/HQ_4_1/src/org/hyperic/hq/authz/shared/PermissionManagerImpl.java Log: [HHQ-2888] Don't return any alerts or alert definition for resources pending delete [merge from HEAD] Modified: branches/HQ_4_1/src/org/hyperic/hq/authz/shared/PermissionManagerImpl.java =================================================================== --- branches/HQ_4_1/src/org/hyperic/hq/authz/shared/PermissionManagerImpl.java 2009-02-27 05:31:06 UTC (rev 12630) +++ branches/HQ_4_1/src/org/hyperic/hq/authz/shared/PermissionManagerImpl.java 2009-02-27 05:32:56 UTC (rev 12631) @@ -380,16 +380,15 @@ }; } - public String getAlertsHQL(boolean inEscalation, boolean notFixed, Integer groupId, boolean count) { // Join with Resource for sorting return "select " + (count ? "count(a)" : "a") + " from " + (inEscalation ? "EscalationState es, " : "") + - "Alert a " + + "Alert a " + "join a.alertDefinition d " + "join d.resource r " + - "where " + + "where r.resourceType is not null and " + (groupId == null ? "" : "exists (select rg from r.groupBag rg " + "where rg.group.id = " + groupId + ") and ") + @@ -397,13 +396,13 @@ (notFixed ? " a.fixed = false and " : "") + "d.priority >= :priority " + (inEscalation ? "and a.id = es.alertId and " + - "es.alertDefinitionId = d.id " : ""); + "es.alertDefinitionId = d.id " : ""); } public String getAlertDefsHQL() { return "select d from AlertDefinition d " + "join d.resource r " + - "where d.priority >= :priority"; + "where r.resourceType is not null and d.priority >= :priority"; } public String getGroupAlertsHQL(boolean inEscalation, boolean notFixed, |