From: <dcr...@hy...> - 2009-07-08 19:00:57
|
Author: dcrutchf Date: 2009-07-08 12:00:47 -0700 (Wed, 08 Jul 2009) New Revision: 13484 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13484 Modified: trunk/src/org/hyperic/hq/ui/action/portlet/DisplayDashboardAction.java Log: [HQ-1770] - Creating Role through HQApi does not create the default role dashboard Tweaked the logic to create a default dashboard if one doesn't exist, regardless of the logged in user (this code will only execute in the case where roles are created w/o a default dashboard) Modified: trunk/src/org/hyperic/hq/ui/action/portlet/DisplayDashboardAction.java =================================================================== --- trunk/src/org/hyperic/hq/ui/action/portlet/DisplayDashboardAction.java 2009-07-08 08:11:30 UTC (rev 13483) +++ trunk/src/org/hyperic/hq/ui/action/portlet/DisplayDashboardAction.java 2009-07-08 19:00:47 UTC (rev 13484) @@ -42,6 +42,7 @@ import org.apache.struts.tiles.ComponentContext; import org.apache.struts.tiles.actions.TilesAction; import org.hyperic.hq.authz.server.session.AuthzSubject; +import org.hyperic.hq.authz.server.session.AuthzSubjectManagerEJBImpl; import org.hyperic.hq.authz.shared.AuthzConstants; import org.hyperic.hq.authz.shared.PermissionException; import org.hyperic.hq.bizapp.shared.AuthzBoss; @@ -153,13 +154,18 @@ // See if we need to initialize the dashboard (for Roles) // we now check both columns for null-ness, instead of only the first + // TODO This typically will only occur if the role was created via API + // We'll need to add some logic to role creation in hqapi so that + // dashboard creation happens, however for 4.2 this is not something + // we can squeeze in, this will suffice for the time being if (dashPrefs.getValue(Constants.USER_PORTLETS_FIRST) == null && dashPrefs.getValue(Constants.USER_PORTLETS_SECOND) == null) { ConfigResponse defaultRoleDashPrefs = (ConfigResponse) ctx.getAttribute(Constants.DEF_ROLE_DASH_PREFS); try { - dashManager.configureDashboard(me, dashboardConfig, + AuthzSubject overlord = AuthzSubjectManagerEJBImpl.getOne().getOverlordPojo(); + dashManager.configureDashboard(overlord, dashboardConfig, defaultRoleDashPrefs); dashPrefs.merge(defaultRoleDashPrefs, true); } catch (PermissionException e) { |