Skip to content

Commit

Permalink
Merge pull request #47408 from HezekielT/fix-expense-composer-disappe…
Browse files Browse the repository at this point in the history
…rs-for-auditor

Fix - Expense - Composer in expense report disappears on Auditor's end after employee submits report
  • Loading branch information
bondydaa authored Aug 16, 2024
2 parents 279f561 + c2775b5 commit 7db1162
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ const CONST = {
WRITE: 'write',
SHARE: 'share',
OWN: 'own',
AUDITOR: 'auditor',
},
INVOICE_RECEIVER_TYPE: {
INDIVIDUAL: 'individual',
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ function isJoinRequestInAdminRoom(report: OnyxEntry<Report>): boolean {
*/
function canWriteInReport(report: OnyxEntry<Report>): boolean {
if (Array.isArray(report?.permissions) && report?.permissions.length > 0) {
return report?.permissions?.includes(CONST.REPORT.PERMISSIONS.WRITE);
return report?.permissions?.includes(CONST.REPORT.PERMISSIONS.WRITE) || (report?.permissions?.includes(CONST.REPORT.PERMISSIONS.AUDITOR) && isExpenseReport(report));
}

return true;
Expand Down

0 comments on commit 7db1162

Please sign in to comment.