Skip to content

FINERACT-2753: Improve Maker-Checker Action Endpoint Handling and Permission Responses - #6255

Open
rymghosn wants to merge 1 commit into
apache:developfrom
foodeveloper:port/CBS-577-improve-maker-checker-action-endpoint-handling
Open

FINERACT-2753: Improve Maker-Checker Action Endpoint Handling and Permission Responses#6255
rymghosn wants to merge 1 commit into
apache:developfrom
foodeveloper:port/CBS-577-improve-maker-checker-action-endpoint-handling

Conversation

@rymghosn

Copy link
Copy Markdown
Contributor

Today, maker-checker enabled actions have two rough edges:

  1. A maker can resubmit the same action on the same resource any number of times while an earlier submission is still AWAITING_APPROVAL, silently
    creating multiple redundant pending entries for the same underlying change.
  2. A user who only holds the checker permission for a task (e.g. DISBURSE_LOAN_CHECKER, but not DISBURSE_LOAN) and who tries to submit that
    action directly currently falls through to the generic NoAuthorizationException ("User has no authority to: ...") — which reads like a
    permissions-configuration bug rather than telling the user they should be approving a pending entry instead of initiating one.

This PR adds two targeted, backwards-compatible checks in PortfolioCommandSourceWritePlatformServiceImpl#logCommandSource, only for tasks that
have maker-checker enabled:

  • Duplicate pending submission: if the current user has the base permission (a "maker") but not the task's _CHECKER permission, and a command
    already exists with status AWAITING_APPROVAL for the same action name, entity name and resource id, the new submission is rejected with a new
    MakerCheckerDuplicatePendingSubmissionException (HTTP 409) instead of being queued as another pending entry.
  • Checker-only initiation: if the current user lacks the base permission but holds the task's _CHECKER permission (or is a CHECKER_SUPER_USER),
    the request is rejected with a new MakerCheckerCheckerOnlyInitiationException (HTTP 403) telling them to use the approval flow instead.
    Users who hold both the base and _CHECKER permission for a task, and any non maker-checker-enabled action, are unaffected. This PR intentionally
    does not change approveEntry or introduce any new self-approval semantics — it only tightens the initiation path.
    PR:(https://issues.apache.org/jira/browse/FINERACT-2753)

…mission responses

Block a maker-only user from submitting a duplicate maker-checker action
while a submission for the same action/entity/resource is still awaiting
checker approval, and give a checker-only user (has only the `_CHECKER`
permission) a clear refusal message when attempting to initiate an action
directly instead of approving a pending one. Non maker-checker flows and
users holding both the base and checker permission are unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant