This is an automated email from the ASF dual-hosted git repository.

mridulpathak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 62fe61202f Fixed: quickReturnFromOrder() permission guard is a no-op 
due to an operator-precedence error
62fe61202f is described below

commit 62fe61202f02c956972665aa24135749ebfef137
Author: Mridul Pathak <[email protected]>
AuthorDate: Fri Sep 25 21:20:47 2026 +0530

    Fixed: quickReturnFromOrder() permission guard is a no-op due to an 
operator-precedence error
    
    !parameters.fromPartyId == userLogin.partyId compares a boolean to a 
String, since ! binds tighter than ==, making the guard's second condition 
effectively always false. Restores the intended parameters.fromPartyId != 
userLogin.partyId comparison.
---
 .../org/apache/ofbiz/order/order/OrderReturnServicesScript.groovy       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderReturnServicesScript.groovy
 
b/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderReturnServicesScript.groovy
index 1d661b1e93..5f98a5a268 100644
--- 
a/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderReturnServicesScript.groovy
+++ 
b/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderReturnServicesScript.groovy
@@ -425,7 +425,7 @@ Map quickReturnFromOrder() {
     GenericValue returnItemTypeMapping
 
     if (!security.hasEntityPermission('ORDERMGR', '_CREATE', 
parameters.userLogin)
-            && !parameters.fromPartyId == userLogin.partyId) {
+            && parameters.fromPartyId != userLogin.partyId) {
         return informError('OrderSecurityErrorToRunQuickReturnFromOrder')
     }
 

Reply via email to