Repository navigation
Fixed: Missing permission checks on FinAccount create/update/delete services - #2266
Open
mridulpathak wants to merge 2 commits into
Open
mridulpathak wants to merge 2 commits into
mridulpathak wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backported from trunk (#2265).