Skip to content

[Due for payment 2026-06-29] [Due for payment 2026-05-20] [$250] Copilot with limited access level can reject expenses, which contradicts the statement #75166

Closed

Description

@jponikarchuk

If you haven't already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Updated 2026-04-25: Narrowed scope per this comment from aimane-chnaif — the reject case is now fixed, but the retract case is still not fixed.

Version Number: 9.2.58-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: Exp https://test-management.browserstack.com/projects/2219752/test-runs/TR-1965/41236699/1013855572?q=copilot&issue_type=jira
Email or phone of affected tester (no customers): applausetester+141104kh@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Account > Security.
  3. Click Add copilot.
  4. Select User B.
  5. Select Limited access level.
    -> On confirm page, it states "Allow another member to take most actions in your paccount, on your behalf. Excludes approvals, payments, rejections, and holds."
  6. Click Add copilot and enter magic code.
  7. Go to workspace chat.
  8. Create an expense and click Submit.
  9. As User B (copilot), open account switcher and switch to User A.
  10. [Copilot] Go to workspace chat and open the expense report.
  11. [Copilot] Click More > Hold.
    -> Hold action is denied in accordance with "Allow another member to take most actions in your paccount, on your behalf. Excludes approvals, payments, rejections, and holds." - Expected.
  12. [Copilot] Click More > Reject. (Reject case is now fixed)
  13. [Copilot] Retract the expense.

Expected Result:

Copilot with limited access level should be blocked from retracting an expense because limited access "Excludes approvals, payments, rejections, and holds."

Actual Result:

Copilot with limited access level can reject expense despite the Limited access level statement. Reject is now fixed. However, copilot with limited access level can still retract an expense, which should also be blocked.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021989470519323088195
  • Upwork Job ID: 1989470519323088195
  • Last Price Increase: 2025-11-21
  • Automatic offers:
    • aimane-chnaif | Reviewer | 111348147
Issue OwnerCurrent Issue Owner: @Eskalifer1

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 14, 2025
  2. melvin-bot commented on Nov 14, 2025

    @melvin-bot

    Triggered auto assignment to @lydiabarclay (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. Eskalifer1 commented on Nov 14, 2025

    @Eskalifer1
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Copilot with limited access level can reject expenses, which contradicts the statement

    What is the root cause of that problem?

    We are missing here check:

    onSelected: () => {
    if (dismissedRejectUseExplanation) {
    if (requestParentReportAction) {
    rejectMoneyRequestReason(requestParentReportAction);
    }
    } else {
    setRejectModalAction(CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.REJECT);
    }
    },

    What changes do you think we should make in order to solve the problem?

    We should add check for copilot:

                    if (isDelegateAccessRestricted) {
                        showDelegateNoAccessModal();
                        return;
                    }
    1. [CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.REJECT]: {
      text: translate('common.reject'),
      icon: expensifyIcons.ThumbsDown,
      value: CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.REJECT,
      onSelected: () => {
      if (dismissedRejectUseExplanation) {
      if (parentReportAction) {
      rejectMoneyRequestReason(parentReportAction);
      }
      } else {
      setRejectModalAction(CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.REJECT);
      }
      },
      },
      };
    2. const dismissModalAndUpdateUseHold = () => {
      setIsHoldEducationalModalVisible(false);
      setNameValuePair(ONYXKEYS.NVP_DISMISSED_HOLD_USE_EXPLANATION, true, false, !network?.shouldFailAllRequests);
      if (requestParentReportAction) {
      changeMoneyRequestHoldStatus(requestParentReportAction);
      }
      };
    3. const dismissRejectModalBasedOnAction = () => {
      if (rejectModalAction === CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.HOLD) {
      dismissRejectUseExplanation();
      if (requestParentReportAction) {
      changeMoneyRequestHoldStatus(requestParentReportAction);
      }
      } else {
      dismissRejectUseExplanation();
      if (requestParentReportAction) {
      rejectMoneyRequestReason(requestParentReportAction);
      }
      }
      setRejectModalAction(null);
      };
    4. onSelected: () => {
      if (dismissedRejectUseExplanation) {
      if (requestParentReportAction) {
      rejectMoneyRequestReason(requestParentReportAction);
      }
      } else {
      setRejectModalAction(CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.REJECT);
      }
      },
    5. const dismissModalAndUpdateUseHold = () => {
      setIsHoldEducationalModalVisible(false);
      setNameValuePair(ONYXKEYS.NVP_DISMISSED_HOLD_USE_EXPLANATION, true, false, !network?.shouldFailAllRequests);
      if (parentReportAction) {
      changeMoneyRequestHoldStatus(parentReportAction);
      }
      };
    6. const dismissRejectModalBasedOnAction = () => {
      if (rejectModalAction === CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.HOLD) {
      dismissRejectUseExplanation();
      if (parentReportAction) {
      changeMoneyRequestHoldStatus(parentReportAction);
      }
      } else {
      dismissRejectUseExplanation();
      if (parentReportAction) {
      rejectMoneyRequestReason(parentReportAction);
      }
      }
      setRejectModalAction(null);
      };
    7. const onSubmit = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.MONEY_REQUEST_REJECT_FORM>) => {
      const urlToNavigateBack = rejectMoneyRequest(transactionID, reportID, values.comment);
      removeTransaction(transactionID);
      Navigation.dismissModal();
      if (urlToNavigateBack) {
      Navigation.isNavigationReady().then(() => Navigation.goBack(urlToNavigateBack));
      }
      };
    8. const onSubmit = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.MONEY_REQUEST_HOLD_FORM>) => {
      // We have extra isWorkspaceRequest condition since, for 1:1 requests, canEditMoneyRequest will rightly return false
      // as we do not allow requestee to edit fields like description and amount.
      // But, we still want the requestee to be able to put the request on hold
      if (isMoneyRequestAction(parentReportAction) && !canEditMoneyRequest(parentReportAction) && isWorkspaceRequest) {
      return;
      }
      putOnHold(transactionID, values.comment, reportID);
      Navigation.goBack(backTo);
      };
    9. onPress: (closePopover, {moneyRequestAction}) => {
      if (closePopover) {
      hideContextMenu(false, () => changeMoneyRequestHoldStatus(moneyRequestAction));
      return;
      }
      // No popover to hide, call changeMoneyRequestHoldStatus immediately
      changeMoneyRequestHoldStatus(moneyRequestAction);
      },

    In case we want to have this logic in remove hold actions:
    10.

    onPress={() => {
    const parentReportAction = getReportAction(moneyRequestReport?.parentReportID, moneyRequestReport?.parentReportActionID);
    const IOUActions = getAllExpensesToHoldIfApplicable(moneyRequestReport, reportActions, transactions, policy);
    if (IOUActions.length) {
    IOUActions.forEach(changeMoneyRequestHoldStatus);
    return;
    }
    const moneyRequestAction = transactionThreadReportID ? requestParentReportAction : parentReportAction;
    if (!moneyRequestAction) {
    return;
    }
    changeMoneyRequestHoldStatus(moneyRequestAction);

    11.
    onSelected: () => {
    if (!requestParentReportAction) {
    throw new Error('Parent action does not exist');
    }
    changeMoneyRequestHoldStatus(requestParentReportAction);
    },

    12.
    onPress={() => {
    changeMoneyRequestHoldStatus(parentReportAction);
    }}

    13.
    onSelected: () => {
    if (!parentReportAction) {
    throw new Error('Parent action does not exist');
    }
    changeMoneyRequestHoldStatus(parentReportAction);
    },

    14.
    onPress: (closePopover, {moneyRequestAction}) => {
    if (closePopover) {
    hideContextMenu(false, () => changeMoneyRequestHoldStatus(moneyRequestAction));
    return;
    }
    // No popover to hide, call changeMoneyRequestHoldStatus immediately
    changeMoneyRequestHoldStatus(moneyRequestAction);
    },

    Search page:
    15.

    onSelected: () => {
    if (isOffline) {
    setIsOfflineModalVisible(true);
    return;
    }
    Navigation.navigate(ROUTES.TRANSACTION_HOLD_REASON_RHP);
    },

    In case of remove hold:
    16.

    onSelected: () => {
    if (isOffline) {
    setIsOfflineModalVisible(true);
    return;
    }
    unholdMoneyRequestOnSearch(hash, selectedTransactionsKeys);
    // eslint-disable-next-line @typescript-eslint/no-deprecated
    InteractionManager.runAfterInteractions(() => {
    clearSelectedTransactions();
    });
    },

    1. const onSubmit = useCallback(
      ({comment}: FormOnyxValues<typeof ONYXKEYS.FORMS.MONEY_REQUEST_HOLD_FORM>) => {
      if (route.name === SCREENS.SEARCH.MONEY_REQUEST_REPORT_HOLD_TRANSACTIONS) {
      putTransactionsOnHold(context.selectedTransactionIDs, comment, reportID);
      context.clearSelectedTransactions(true);
      } else {
      holdMoneyRequestOnSearch(context.currentSearchHash, Object.keys(context.selectedTransactions), comment, allTransactions, allReportActions);
      context.clearSelectedTransactions();
      }
      Navigation.goBack();
      },
      [route.name, context, reportID, allTransactions, allReportActions],
      );

    2. onSelected: () => {
      if (isOffline) {
      setIsOfflineModalVisible(true);
      return;
      }
      // Check if any of the selected items have DEW enabled
      const selectedPolicyIDList = selectedReports.length
      ? selectedReports.map((report) => report.policyID)
      : Object.values(selectedTransactions).map((transaction) => transaction.policyID);
      const hasDEWPolicy = selectedPolicyIDList.some((policyID) => {
      const policy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`];
      return hasDynamicExternalWorkflow(policy);
      });
      if (hasDEWPolicy) {
      setIsDEWModalVisible(true);
      return;
      }
      const reportIDList = !selectedReports.length
      ? Object.values(selectedTransactions).map((transaction) => transaction.reportID)
      : (selectedReports?.filter((report) => !!report).map((report) => report.reportID) ?? []);
      approveMoneyRequestOnSearch(hash, reportIDList);
      // eslint-disable-next-line @typescript-eslint/no-deprecated
      InteractionManager.runAfterInteractions(() => {
      clearSelectedTransactions();
      });
      },

    3. we might also want to add this logic here:

      const onBulkPaySelected = useCallback(

    4. onSelected: () => {
      if (!report?.reportID) {
      return;
      }
      Navigation.navigate(ROUTES.SEARCH_MONEY_REQUEST_REPORT_HOLD_TRANSACTIONS.getRoute({reportID: report.reportID}));
      },

    5. onSelected: () => {
      for (const transactionID of selectedTransactionIDs) {
      const action = getIOUActionForTransactionID(reportActions, transactionID);
      if (!action?.childReportID) {
      continue;
      }
      unholdRequest(transactionID, action?.childReportID);
      }
      clearSelectedTransactions(true);
      },

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. daledah commented on Nov 14, 2025

    @daledah
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Copilot with limited access level can reject expense despite the Limited access level statement "Allow another member to take most actions in your paccount, on your behalf. Excludes approvals, payments, rejections, and holds."

    What is the root cause of that problem?

    We are missing to check for the copilot when the user clicks reject button

    if (dismissedRejectUseExplanation) {
    if (requestParentReportAction) {
    rejectMoneyRequestReason(requestParentReportAction);
    }
    } else {
    setRejectModalAction(CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.REJECT);
    }

    onSelected: () => {
    if (dismissedRejectUseExplanation) {
    if (parentReportAction) {
    rejectMoneyRequestReason(parentReportAction);
    }
    } else {
    setRejectModalAction(CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.REJECT);
    }
    },
    },

    What changes do you think we should make in order to solve the problem?

    We should add the check for the copilot to show the delegate no access modal in both MoneyReportHeader and MoneyRequestHeader to avoid the regressions

          if (isDelegateAccessRestricted) {
              showDelegateNoAccessModal();
              return;
          }
    

    const dismissRejectModalBasedOnAction = () => {
    if (rejectModalAction === CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.HOLD) {
    dismissRejectUseExplanation();
    if (parentReportAction) {
    changeMoneyRequestHoldStatus(parentReportAction);
    }
    } else {
    dismissRejectUseExplanation();
    if (parentReportAction) {
    rejectMoneyRequestReason(parentReportAction);
    }
    }
    setRejectModalAction(null);
    };

    if (dismissedRejectUseExplanation) {
    if (parentReportAction) {
    rejectMoneyRequestReason(parentReportAction);
    }

    onPress={() => {
    changeMoneyRequestHoldStatus(parentReportAction);
    }}

    if (parentReportAction) {
    changeMoneyRequestHoldStatus(parentReportAction);
    }

    if (!parentReportAction) {
    throw new Error('Parent action does not exist');
    }
    changeMoneyRequestHoldStatus(parentReportAction);

    const dismissRejectModalBasedOnAction = () => {
    if (rejectModalAction === CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.HOLD) {
    dismissRejectUseExplanation();
    if (requestParentReportAction) {
    changeMoneyRequestHoldStatus(requestParentReportAction);
    }
    } else {
    dismissRejectUseExplanation();
    if (requestParentReportAction) {
    rejectMoneyRequestReason(requestParentReportAction);
    }
    }

    if (dismissedRejectUseExplanation) {
    if (requestParentReportAction) {
    rejectMoneyRequestReason(requestParentReportAction);
    }

    if (requestParentReportAction) {
    changeMoneyRequestHoldStatus(requestParentReportAction);
    }

    if (IOUActions.length) {
    IOUActions.forEach(changeMoneyRequestHoldStatus);
    return;

    if (!requestParentReportAction) {
    throw new Error('Parent action does not exist');
    }
    changeMoneyRequestHoldStatus(requestParentReportAction);

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Nov 14, 2025
  6. melvin-bot commented on Nov 14, 2025

    @melvin-bot
  7. changed the title [-]Copilot with limited access level can reject expenses, which contradicts the statement[/-] [+][$250] Copilot with limited access level can reject expenses, which contradicts the statement[/+] on Nov 14, 2025
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 14, 2025
  9. melvin-bot commented on Nov 14, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (External)

  10. aimane-chnaif commented on Nov 21, 2025

    @aimane-chnaif
    Contributor

    PS: we can add this check for other actions if needed

    @Eskalifer1 if you want your proposal to be approved, can you please find out all instances where copilot can access hold/reject (or any other limited actions) throughout the app?
    Please check all cases - one transaction report, multiple transactions report, etc.

    (Note: @daledah's proposal is not complete, still missing cases)

  11. 111 remaining items

  12. Eskalifer1 commented on May 22, 2026

    @Eskalifer1
    Contributor

    All good 👍. I have accepted, thank you!

    cc: @mallenexpensify

  13. mallenexpensify commented on May 22, 2026

    @mallenexpensify
    Contributor

    @Eskalifer1 paid (for real), summary updated above. Thx.

  14. changed the title [-][Due for payment 2026-05-20] [$250] Copilot with limited access level can reject expenses, which contradicts the statement[/-] [+][Due for payment 2026-06-29] [Due for payment 2026-05-20] [$250] Copilot with limited access level can reject expenses, which contradicts the statement[/+] on Jun 22, 2026
  15. melvin-bot commented on Jun 22, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  16. melvin-bot commented on Jun 22, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.16-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-06-29. 🎊

    For reference, here are some details about the assignees on this issue:

  17. melvin-bot commented on Jun 22, 2026

    @melvin-bot

    @Eskalifer1 / @aimane-chnaif @mallenexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  18. garrettmknight commented on Jul 19, 2026

    @garrettmknight
    Contributor

    $250 apprvoed for @aimane-chnaif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions