Author: hansbak
Date: Tue Aug 28 08:30:10 2012
New Revision: 1378020
URL:
http://svn.apache.org/viewvc?rev=1378020&view=revLog:
OFBiz 5018: LoginWorker does not check a base permission for the root mount point
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java
Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java?rev=1378020&r1=1378019&r2=1378020&view=diff==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java Tue Aug 28 08:30:10 2012
@@ -981,7 +981,13 @@ public class LoginWorker {
if (security != null) {
ServletContext context = (ServletContext) request.getAttribute("servletContext");
String serverId = (String) context.getAttribute("_serverId");
+
+ // get a context path from the request, if it is empty then assume it is the root mount point
String contextPath = request.getContextPath();
+ if (UtilValidate.isEmpty(contextPath)) {
+ contextPath = "/";
+ }
+
ComponentConfig.WebappInfo info = ComponentConfig.getWebAppInfo(serverId, contextPath);
if (info != null) {
for (String permission: info.getBasePermission()) {