This is an automated email from the ASF dual-hosted git repository.
mridulpathak pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release24.09 by this push:
new d2ac84d746 Fixed: quickReturnFromOrder() permission guard is a no-op
due to an operator-precedence error
d2ac84d746 is described below
commit d2ac84d746354c62a3749d90d5d6a06bbe3215e4
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 9f8af58dde..bff11c20b9 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')
}