Skip to content

Fixed: Missing permission checks on FinAccount create/update/delete services - #2266

Open
mridulpathak wants to merge 2 commits into
apache:release24.09from
mridulpathak:worktree-finaccount-missing-authorization-release24.09
Open

mridulpathak wants to merge 2 commits into
apache:release24.09from
mridulpathak:worktree-finaccount-missing-authorization-release24.09

Conversation

@mridulpathak

Copy link
Copy Markdown
Contributor

Backported from trunk (#2265).

Several Financial Account services (createFinAccount, updateFinAccount,
deleteFinAccount, createFinAccountTrans, createFinAccountRole,
createFinAccountAuth, setFinAccountTransStatus, depositWithdrawPayments)
had neither auth nor a permission-service, so any authenticated session
could call them directly. Wire the existing (previously UI-only)
acctgFinAcctPermissionCheck permission-service into each of these
service definitions, matching the convention already used for sibling
services in this file (updateFinAccountRole, deleteFinAccountRole).

Several internal callers invoke these services as a trusted side effect
of an already-validated operation (gift certificate purchase/reload/
redemption, financial-account payment authorization/capture, auto-
replenish, and return/store-credit processing), using the initiating
customer's or CSR's own userLogin. Elevate those specific calls to the
system user, mirroring the existing pattern in
GiftCertificateServices#createGiftCertificate, so the new permission
checks don't block legitimate checkout and return flows:

- FinAccountPaymentServices: financial-account auth/capture/withdraw/
  deposit/replenish
- GiftCertificateServices: gift certificate creation, reload, redemption,
  and authorization
- OrderReturnServices: store-credit creation on return processing
- FinAccountProductServices: financial-account purchase fulfillment
…stem user

createAccountAndCredit (shared by createServiceCredit and createFinAccountAndCredit) was the one caller in this change not elevated to the system user, so a caller without accounting permission now gets rejected by createFinAccount/createFinAccountRole/createFinAccountTrans.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant