You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2026/10/26 15:51:11 UTC
(ofbiz-framework) branch release24.09 updated: Fix party invitation permission and status handling and the lead phone extension
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 8fdc1c7bbd Fix party invitation permission and status handling and the lead phone extension
8fdc1c7bbd is described below
commit 8fdc1c7bbdfd23022ea12f946ded29b8ce2f7c23
Author: Mridul Pathak <mr...@gmail.com>
AuthorDate: Thu Oct 22 19:24:22 2026 +0530
Fix party invitation permission and status handling and the lead phone extension
Three regressions from the minilang conversion:
- acceptPartyInvitation creates the missing roles through createPartyRole, which carries the party role permission check, instead of the permission-free ensurePartyRole, so an invitee can no longer add the invitation roles to an arbitrary party.
- declinePartyInvitation and cancelPartyInvitation are real wrappers around updatePartyInvitation that set PARTYINV_DECLINED and PARTYINV_CANCELLED, and no longer accept a statusId from the caller.
- createPersonRoleAndContactMechs declares the optional extension attribute, so the phone extension entered when creating a lead is not filtered out by run service anymore.
---
applications/party/servicedef/services.xml | 7 +++----
.../ofbiz/party/party/PartyInvitationServices.groovy | 16 +++++++++++++---
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/applications/party/servicedef/services.xml b/applications/party/servicedef/services.xml
index b653dcb077..81e1f96ead 100644
--- a/applications/party/servicedef/services.xml
+++ b/applications/party/servicedef/services.xml
@@ -137,6 +137,7 @@ under the License.
<auto-attributes entity-name="TelecomNumber" mode="IN" optional="true"/>
<attribute name="roleTypeId" mode="IN" type="String"/>
<attribute name="emailAddress" type="String" mode="IN" optional="true"/>
+ <attribute name="extension" type="String" mode="IN" optional="true"/>
<attribute name="partyId" mode="OUT" type="String" optional="false"/>
</service>
<service name="updatePerson" engine="java" default-entity-name="Person"
@@ -1250,20 +1251,18 @@ under the License.
</attribute>
</service>
<service name="declinePartyInvitation" engine="groovy"
- location="component://party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy" invoke="updatePartyInvitation">
+ location="component://party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy" invoke="declinePartyInvitation">
<permission-service service-name="accAndDecPartyInvitationPermissionCheck"/>
<attribute name="partyInvitationId" type="String" mode="IN" optional="false">
<type-validate>
<fail-property resource="PartyErrorUiLabels" property="PartyRequiredFieldMissingPartyInvitationId"/>
</type-validate>
</attribute>
- <attribute name="statusId" type="String" mode="IN" optional="true" default-value="PARTYINV_DECLINED"/>
</service>
<service name="cancelPartyInvitation" engine="groovy"
- location="component://party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy" invoke="updatePartyInvitation">
+ location="component://party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy" invoke="cancelPartyInvitation">
<permission-service service-name="cancelPartyInvitationPermissionCheck"/>
<attribute name="partyInvitationId" type="String" mode="IN"/>
- <attribute name="statusId" type="String" mode="IN" optional="true" default-value="PARTYINV_CANCELLED"/>
</service>
<!-- Permission checking services-->
diff --git a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy
index d4a5074406..b743f61130 100644
--- a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy
+++ b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy
@@ -67,10 +67,11 @@ Map acceptPartyInvitation() {
.where(partyInvitationId: parameters.partyInvitationId)
.queryList()
if (partyInvitationRoleAssocs) {
- Map ensurePartyRoleCtx = [partyId: parameters.partyId]
+ // createPartyRole carries the permission check, ensurePartyRole does not
partyInvitationRoleAssocs.each {
- ensurePartyRoleCtx.roleTypeId = it.roleTypeId
- run service: 'ensurePartyRole', with: ensurePartyRoleCtx
+ if (!from('PartyRole').where(partyId: parameters.partyId, roleTypeId: it.roleTypeId).queryOne()) {
+ run service: 'createPartyRole', with: [partyId: parameters.partyId, roleTypeId: it.roleTypeId]
+ }
}
}
@@ -80,3 +81,12 @@ Map acceptPartyInvitation() {
return result
}
+Map declinePartyInvitation() {
+ return run(service: 'updatePartyInvitation', with: [partyInvitationId: parameters.partyInvitationId,
+ statusId: 'PARTYINV_DECLINED'])
+}
+
+Map cancelPartyInvitation() {
+ return run(service: 'updatePartyInvitation', with: [partyInvitationId: parameters.partyInvitationId,
+ statusId: 'PARTYINV_CANCELLED'])
+}