Skip to content

Commit

Permalink
fix: admin can delete expenses
Browse files Browse the repository at this point in the history
  • Loading branch information
daledah committed Sep 11, 2024
1 parent 762bffc commit b889777
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
report.stateNum !== CONST.REPORT.STATE_NUM.APPROVED &&
!ReportUtils.isClosedReport(report) &&
canModifyTask;
const canDeleteRequest = isActionOwner && (ReportUtils.canDeleteTransaction(moneyRequestReport) || isSelfDMTrackExpenseReport) && !isDeletedParentAction;
const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN;
const canDeleteRequest = (isActionOwner || isAdmin) && (ReportUtils.canDeleteTransaction(moneyRequestReport) || isSelfDMTrackExpenseReport) && !isDeletedParentAction;
const shouldShowDeleteButton = shouldShowTaskDeleteButton || canDeleteRequest;

const canUnapproveRequest =
Expand Down

0 comments on commit b889777

Please sign in to comment.