Permalink
Browse files

Slightly different patch to fix the auto save cart functionality for …

…anonymous user reported by Mirko on OFBIZ-5157.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1459220 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent ff69b1e commit defe51b0c358ff5d8b4d3d8eb85aab1759ab0777 Vikas Mayur committed Mar 21, 2013
Showing with 13 additions and 2 deletions.
  1. +13 −2 applications/order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml
@@ -121,7 +121,19 @@ under the License.
<if-empty field="shoppingListItems">
<set field="parentMethodName" value="createShoppingListItem"/>
<set field="permissionAction" value="CREATE"/>
- <call-simple-method method-name="checkShoppingListItemSecurity"/>
+ <entity-one entity-name="ShoppingList" value-field="shoppingList"/>
+ <if>
+ <condition>
+ <and>
+ <not><if-empty field="shoppingList.partyId"/></not>
+ <not><if-compare-field field="userLogin.partyId" to-field="shoppingList.partyId" operator="equals"/></not>
+ <not><if-has-permission permission="PARTYMGR" action="_${permissionAction}"/></not>
+ </and>
+ </condition>
+ <then>
+ <add-error><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunForAnotherParty"/></add-error>
+ </then>
+ </if>
<check-errors/>
<entity-one entity-name="ShoppingList" value-field="shoppingList"/>
@@ -288,7 +300,6 @@ under the License.
<if>
<condition>
<and>
- <not><if-empty field="shoppingList.partyId"/></not>
<not><if-compare-field field="userLogin.partyId" to-field="shoppingList.partyId" operator="equals"/></not>
<not><if-has-permission permission="PARTYMGR" action="_${permissionAction}"/></not>
</and>

0 comments on commit defe51b

Please sign in to comment.