Skip to content

Commit 63f341a

Browse files
aldo-expensifyOSBotify
authored andcommitted
Merge pull request #78940 from Expensify/revert-76688-fix-Allow-approvers-to-edit-expenses-on-draft-open-reports
Revert "feat: Allow approvers to edit expenses on draft open reports" (cherry picked from commit f3fef7b) (cherry-picked to staging by arosiclair)
1 parent fee098f commit 63f341a

File tree

2 files changed

+4
-403
lines changed

2 files changed

+4
-403
lines changed

src/libs/ReportUtils.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4544,11 +4544,6 @@ function canEditMoneyRequest(
45444544
return true;
45454545
}
45464546

4547-
// Allow workflow approvers to edit OPEN expense reports
4548-
if (isExpenseReport(moneyRequestReport) && isOpenReport(moneyRequestReport) && currentUserAccountID === getManagerAccountID(reportPolicy, moneyRequestReport)) {
4549-
return true;
4550-
}
4551-
45524547
if (reportPolicy?.type === CONST.POLICY.TYPE.CORPORATE && moneyRequestReport && isSubmitted && isCurrentUserSubmitter(moneyRequestReport)) {
45534548
const isForwarded = getSubmitToAccountID(reportPolicy, moneyRequestReport) !== moneyRequestReport.managerID;
45544549
return !isForwarded;
@@ -4617,8 +4612,7 @@ function canEditReportPolicy(report: OnyxEntry<Report>, reportPolicy: OnyxEntry<
46174612

46184613
if (isExpenseType) {
46194614
if (isOpen) {
4620-
const isApprover = currentUserAccountID === getManagerAccountID(reportPolicy, report);
4621-
return isSubmitter || isAdmin || isApprover;
4615+
return isSubmitter || isAdmin;
46224616
}
46234617

46244618
if (isSubmitted) {
@@ -4692,14 +4686,13 @@ function canEditFieldOfMoneyRequest(
46924686
const isAdmin = isExpenseReport(moneyRequestReport) && reportPolicy?.role === CONST.POLICY.ROLE.ADMIN;
46934687
const isManager = isExpenseReport(moneyRequestReport) && currentUserAccountID === moneyRequestReport?.managerID;
46944688
const isRequestor = currentUserAccountID === reportAction?.actorAccountID;
4695-
const isApprover = isExpenseReport(moneyRequestReport) && isOpenReport(moneyRequestReport) && currentUserAccountID === getManagerAccountID(reportPolicy, moneyRequestReport);
46964689

46974690
if (fieldToEdit === CONST.EDIT_REQUEST_FIELD.REIMBURSABLE) {
4698-
return isAdmin || isManager || isRequestor || isApprover;
4691+
return isAdmin || isManager || isRequestor;
46994692
}
47004693

47014694
if ((fieldToEdit === CONST.EDIT_REQUEST_FIELD.AMOUNT || fieldToEdit === CONST.EDIT_REQUEST_FIELD.CURRENCY) && isDistanceRequest(transaction)) {
4702-
return isAdmin || isManager || isRequestor || isApprover;
4695+
return isAdmin || isManager || isRequestor;
47034696
}
47044697

47054698
if (
@@ -4715,7 +4708,7 @@ function canEditFieldOfMoneyRequest(
47154708
!isReceiptBeingScanned(transaction) &&
47164709
!isPerDiemRequest(transaction) &&
47174710
(!isDistanceRequest(transaction) || isManualDistanceRequestTransactionUtils(transaction)) &&
4718-
(isAdmin || isManager || isRequestor || isApprover) &&
4711+
(isAdmin || isManager || isRequestor) &&
47194712
(isDeleteAction ? isRequestor : true)
47204713
);
47214714
}

0 commit comments

Comments
 (0)