You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by GitBox <gi...@apache.org> on 2026/10/15 11:52:17 UTC

[GH] (ofbiz-framework/fix/timesheet-requirement-role-validation): Workflow run "Java CI with Gradle" failed!

The GitHub Actions job "Java CI with Gradle" on ofbiz-framework.git/fix/timesheet-requirement-role-validation has failed.
Run started by GitHub user karthikchundi-commits (triggered by karthikchundi-commits).

Head commit for run:
a7cf91e5bab1bea9a3a8db68bff3f47d297dd6bf / Karth <ka...@gmail.com>
Reject party/role combinations the party does not hold for TimesheetRole and RequirementRole

createTimesheetRole and createRequirementRole have the identical
unvalidated-PartyRole gap already fixed for TaxAuthority (#1692),
Invoice/BillingAccount/FinAccount roles (#1727), and BudgetRole
(#1736): a free-choice RoleType dropdown feeding straight into an
unconditional ensurePartyRole invoke-eca, so any party/role
combination is silently accepted and a spurious PartyRole is
fabricated even when the party doesn't legitimately hold that role.

Both AddTimesheetRole (TimesheetForms.xml) and AddRequirementRole
(RequirementForms.xml) submit directly to their respective create
service with no other caller anywhere in the codebase (verified via a
search across XML/Groovy/Java, not just the immediate eca/form pair),
so the fix mirrors the existing pattern exactly: an in-validate eca
calling the already-built checkPartyRoleExists service before the
invoke-eca that runs ensurePartyRole.

Two other services flagged during this pass - createContentRole and
createQuoteRole - have the same free-choice dropdown on their "assign
role" forms, but are NOT included here: both are also the mechanism
their own components use internally to legitimately grant a brand-new
role a party doesn't hold yet (createContentRole via
ContentManagementServices.java's updateSiteRoles/addRoleToUser
bootstrapping site access; createQuoteRole via
QuoteServicesScript.groovy assigning REQ_TAKER/INTERNAL_ORGANIZATIO
when a quote is created, and copying CustRequestParty roles onto a
converted quote). A blanket in-validate eca on either service would
reject those legitimate internal grants, not just the vulnerable
direct-form path. Fixing those two needs a different approach (validating
at the form-submission event level, not the service level) and is left
for separate follow-up rather than risking a regression here.

Verified: applications/workeffort/servicedef/secas.xml,
applications/order/servicedef/secas.xml, and
applications/workeffort/testdef/workefforttests.xml all validate
against their real XSD schemas (xmllint --schema). Added
TimesheetRoleTests (new) and two tests to the existing
OrderRequirementTests, both following the established pattern: a
negative case using DemoCustomer + CARRIER (a role its seeded
PartyRole set - BILL_TO_CUSTOMER/CONTACT/CUSTOMER/
END_USER_CUSTOMER/PLACING_CUSTOMER/SHIP_TO_CUSTOMER - provably does
not include) and a positive case using a role it already holds.
`./gradlew compileTestGroovy checkstyleMain checkstyleTest codenarcMain
codenarcTest` all BUILD SUCCESSFUL. No running OFBiz+DB instance
available in this environment to execute the Groovy tests end-to-end -
disclosed honestly, same limitation as prior PRs in this series.

Co-authored-by: Claude Sonnet 5 <no...@anthropic.com>
Signed-off-by: Karth <ka...@gmail.com>

Report URL: https://github.com/apache/ofbiz-framework/actions/runs/34965242341

With regards,
GitHub Actions via GitBox