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 aa9e1cbbae Fixed: accAndDecPartyInvitationPermissionCheck shows the 
wrong error message on an identity mismatch (OFBIZ-13595)
aa9e1cbbae is described below

commit aa9e1cbbaee744d5f4eb249a8394a8a7708d3c6b
Author: Mridul Pathak <[email protected]>
AuthorDate: Wed Sep 16 18:10:26 2026 +0530

    Fixed: accAndDecPartyInvitationPermissionCheck shows the wrong error 
message on an identity mismatch (OFBIZ-13595)
    
    When an invitation email resolves to a party that does not match the 
logged-in user, the Groovy conversion returned the same hard 
PartyInvitationNotValidError used when the email does not resolve to any party 
at all, collapsing two distinct minilang cases into one. It now only returns 
that hard error when the email fails to resolve to any party, letting the 
identity-mismatch case fall through to the existing soft-fail path with its own 
PartyInvitationAccAndDecPermissionError message.
---
 .../org/apache/ofbiz/party/party/PartyPermissionServices.groovy  | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git 
a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyPermissionServices.groovy
 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyPermissionServices.groovy
index bb2efb2e20..4abb850a64 100644
--- 
a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyPermissionServices.groovy
+++ 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyPermissionServices.groovy
@@ -179,13 +179,14 @@ Map accAndDecPartyInvitationPermissionCheck() {
             }
             Map serviceResult = run service: 'findPartyFromEmailAddress', 
with: [address: partyInvitation.emailAddress]
             String partyId = serviceResult.partyId
-            if (partyId && partyId == userLogin.partyId) {
-                hasPermission = true
-                result.hasPermission = hasPermission
-            } else {
+            if (!partyId) {
                 return error(UtilProperties.getMessage('PartyUiLabels',
                         'PartyInvitationNotValidError', parameters.locale))
             }
+            if (partyId == userLogin.partyId) {
+                hasPermission = true
+                result.hasPermission = hasPermission
+            }
         }
     }
     if (!hasPermission) {

Reply via email to