Author: jacopoc
Date: Tue Jun 19 16:53:03 2012
New Revision: 1351777
URL:
http://svn.apache.org/viewvc?rev=1351777&view=revLog:
Trivial change to make to avoid to perform a series of useless method calls when the security object is not in the context.
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=1351777&r1=1351776&r2=1351777&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 Jun 19 16:53:03 2012
@@ -1024,15 +1024,13 @@ public class LoginWorker {
}
protected static boolean hasBasePermission(GenericValue userLogin, HttpServletRequest request) {
- ServletContext context = (ServletContext) request.getAttribute("servletContext");
- Authorization authz = (Authorization) request.getAttribute("authz");
Security security = (Security) request.getAttribute("security");
-
- String serverId = (String) context.getAttribute("_serverId");
- String contextPath = request.getContextPath();
-
- ComponentConfig.WebappInfo info = ComponentConfig.getWebAppInfo(serverId, contextPath);
if (security != null) {
+ ServletContext context = (ServletContext) request.getAttribute("servletContext");
+ Authorization authz = (Authorization) request.getAttribute("authz");
+ String serverId = (String) context.getAttribute("_serverId");
+ String contextPath = request.getContextPath();
+ ComponentConfig.WebappInfo info = ComponentConfig.getWebAppInfo(serverId, contextPath);
if (info != null) {
for (String permission: info.getBasePermission()) {
if (!"NONE".equals(permission) && !security.hasEntityPermission(permission, "_VIEW", userLogin) &&