svn commit: r1605056 - in /ofbiz/trunk/applications/party: servicedef/services.xml src/org/ofbiz/party/communication/CommunicationEventServices.java

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

svn commit: r1605056 - in /ofbiz/trunk/applications/party: servicedef/services.xml src/org/ofbiz/party/communication/CommunicationEventServices.java

mor-2
Author: mor
Date: Tue Jun 24 11:25:13 2014
New Revision: 1605056

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

Modified:
    ofbiz/trunk/applications/party/servicedef/services.xml
    ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=1605056&r1=1605055&r2=1605056&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Tue Jun 24 11:25:13 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/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?rev=1605056&r1=1605055&r2=1605056&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Tue Jun 24 11:25:13 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));
             }