From: <jt...@hy...> - 2007-06-12 00:09:21
|
Author: jtravis Date: 2007-06-11 17:09:17 -0700 (Mon, 11 Jun 2007) New Revision: 4729 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=4729 Modified: trunk/src/org/hyperic/hq/hqu/rendit/RenditServer.java trunk/src/org/hyperic/hq/hqu/rendit/RequestInvocationBindings.java Log: Pass user down to RenditServer etc all the way from the servlet Modified: trunk/src/org/hyperic/hq/hqu/rendit/RenditServer.java =================================================================== --- trunk/src/org/hyperic/hq/hqu/rendit/RenditServer.java 2007-06-12 00:08:49 UTC (rev 4728) +++ trunk/src/org/hyperic/hq/hqu/rendit/RenditServer.java 2007-06-12 00:09:17 UTC (rev 4729) @@ -40,6 +40,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.hyperic.hq.authz.server.session.AuthzSubject; import org.hyperic.hq.hqu.UIPluginDescriptor; import org.hyperic.hq.hqu.server.session.UIPluginManagerEJBImpl; @@ -158,12 +159,13 @@ * Handles regular web requests for a UI plugin. */ public void handleRequest(String pluginName, HttpServletRequest req, - HttpServletResponse resp, ServletContext ctx) + HttpServletResponse resp, ServletContext ctx, + AuthzSubject user) throws Exception { PluginWrapper plugin = getPlugin(pluginName); InvocationBindings bindings = - new RequestInvocationBindings(plugin.getPluginDir(), + new RequestInvocationBindings(plugin.getPluginDir(), user, req, resp, ctx); invokeDispatcher(plugin, bindings); } Modified: trunk/src/org/hyperic/hq/hqu/rendit/RequestInvocationBindings.java =================================================================== --- trunk/src/org/hyperic/hq/hqu/rendit/RequestInvocationBindings.java 2007-06-12 00:08:49 UTC (rev 4728) +++ trunk/src/org/hyperic/hq/hqu/rendit/RequestInvocationBindings.java 2007-06-12 00:09:17 UTC (rev 4729) @@ -30,23 +30,32 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.hyperic.hq.authz.server.session.AuthzSubject; + /** * The invocation bindings used when a request is made from the servlet. */ public class RequestInvocationBindings extends InvocationBindings { + private AuthzSubject _user; private HttpServletRequest _request; private HttpServletResponse _response; private ServletContext _context; - RequestInvocationBindings(File pluginDir, HttpServletRequest request, + RequestInvocationBindings(File pluginDir, AuthzSubject user, + HttpServletRequest request, HttpServletResponse response, ServletContext ctx) { super("request", pluginDir); + _user = user; _request = request; _response = response; _context = ctx; } + public AuthzSubject getUser() { + return _user; + } + public HttpServletRequest getRequest() { return _request; } |