You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mo...@apache.org on 2014/06/24 13:32:42 UTC

svn commit: r1605057 - in /ofbiz/branches/release12.04/applications/party: servicedef/services.xml src/org/ofbiz/party/communication/CommunicationEventServices.java

Author: mor
Date: Tue Jun 24 11:32:42 2014
New Revision: 1605057

URL: http://svn.apache.org/r1605057
Log:
Merged from trunk r1605056. Log: Fix: Bypass the permission check to update communication event if userLogin partyId equals partyIdFrom parameter, useful in certain cases for front-end customers.

Modified:
    ofbiz/branches/release12.04/applications/party/servicedef/services.xml
    ofbiz/branches/release12.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java

Modified: ofbiz/branches/release12.04/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/party/servicedef/services.xml?rev=1605057&r1=1605056&r2=1605057&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/party/servicedef/services.xml (original)
+++ ofbiz/branches/release12.04/applications/party/servicedef/services.xml Tue Jun 24 11:32:42 2014
@@ -749,6 +749,7 @@ under the License.
         <attribute name="statusId" type="String" mode="IN" optional="false"/>
         <attribute name="oldStatusId" type="String" mode="OUT" optional="true"/>
         <attribute name="setRoleStatusToComplete" mode="IN" type="String" default-value="N"/>
+        <attribute name="partyIdFrom" type="String" mode="IN" optional="true"/>
     </service>
     <service name="setCommunicationEventRoleStatus" engine="simple" default-entity-name="CommunicationEventRole"
             location="component://party/script/org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="setCommunicationEventRoleStatus" auth="true">
@@ -935,6 +936,7 @@ under the License.
         location="org.ofbiz.party.communication.CommunicationEventServices" invoke="setCommEventComplete" auth="true">
         <description>Sets the status of a communication event to COM_COMPLETE using the updateCommunicationEvent service</description>
         <attribute name="communicationEventId" type="String" mode="IN" optional="false"/>
+        <attribute name="partyIdFrom" type="String" mode="IN" optional="true"/>
     </service>
 
     <service name="sendEmailDated" engine="simple" use-transaction="false"

Modified: ofbiz/branches/release12.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?rev=1605057&r1=1605056&r2=1605057&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java (original)
+++ ofbiz/branches/release12.04/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Tue Jun 24 11:32:42 2014
@@ -233,7 +233,7 @@ public class CommunicationEventServices 
                         return ServiceUtil.returnError(e.getMessage());
                     }
 
-                    Map<String, Object> completeResult = dispatcher.runSync("setCommEventComplete", UtilMisc.<String, Object>toMap("communicationEventId", communicationEventId, "userLogin", userLogin));
+                    Map<String, Object> completeResult = dispatcher.runSync("setCommEventComplete", UtilMisc.<String, Object>toMap("communicationEventId", communicationEventId, "partyIdFrom", communicationEvent.getString("partyIdFrom"),"userLogin", userLogin));
                     if (ServiceUtil.isError(completeResult)) {
                         errorMessages.add(ServiceUtil.getErrorMessage(completeResult));
                     }
@@ -506,10 +506,11 @@ public class CommunicationEventServices 
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         String communicationEventId = (String) context.get("communicationEventId");
+        String partyIdFrom = (String) context.get("partyIdFrom");
 
         try {
             Map<String, Object> result = dispatcher.runSync("updateCommunicationEvent", UtilMisc.<String, Object>toMap("communicationEventId", communicationEventId,
-                    "statusId", "COM_COMPLETE", "userLogin", userLogin));
+                    "partyIdFrom", partyIdFrom, "statusId", "COM_COMPLETE", "userLogin", userLogin));
             if (ServiceUtil.isError(result)) {
                 return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result));
             }