svn commit: r785136 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderList.groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r785136 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderList.groovy

ashish-18
Author: ashish
Date: Tue Jun 16 09:54:01 2009
New Revision: 785136

URL: http://svn.apache.org/viewvc?rev=785136&view=rev
Log:
Applied patch from jira issue OFBIZ-2607 (When searching order list and types of order not selected, It shows permission error.)
Thanks Chirag for your contribution on this.

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderList.groovy

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderList.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderList.groovy?rev=785136&r1=785135&r2=785136&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderList.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderList.groovy Tue Jun 16 09:54:01 2009
@@ -32,13 +32,17 @@
 
 // check permission for each order type
 hasPermission = false;
-if (state.hasType("view_SALES_ORDER") && security.hasEntityPermission("ORDERMGR", "_VIEW", session)) {
-    hasPermission = true;
-    salesOrdersCondition = EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "SALES_ORDER");
+if (security.hasEntityPermission("ORDERMGR", "_VIEW", session)) {
+    if (state.hasType("view_SALES_ORDER") || (!(state.hasType("view_SALES_ORDER")) && !(state.hasType("view_PURCHASE_ORDER")))) {
+        hasPermission = true;
+        salesOrdersCondition = EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "SALES_ORDER");
+    }
 }
-if (state.hasType("view_PURCHASE_ORDER") && security.hasEntityPermission("ORDERMGR", "_PURCHASE_VIEW", session)) {
-    hasPermission = true;
-    purchaseOrdersCondition = EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "PURCHASE_ORDER");
+if (security.hasEntityPermission("ORDERMGR", "_PURCHASE_VIEW", session)) {
+    if (state.hasType("view_PURCHASE_ORDER") || (!(state.hasType("view_SALES_ORDER")) && !(state.hasType("view_PURCHASE_ORDER")))) {
+        hasPermission = true;
+        purchaseOrdersCondition = EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "PURCHASE_ORDER");
+    }
 }
 context.hasPermission = hasPermission;