Skip to content

Commit

Permalink
Merge pull request #40160 from nkdengineer/fix/39659
Browse files Browse the repository at this point in the history
Don't show GBR to AM/guides for managed customer employee invitations
  • Loading branch information
marcochavezf authored Apr 17, 2024
2 parents d7c1256 + 0a370f7 commit c647c30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,15 @@ function isJoinRequestInAdminRoom(report: OnyxEntry<Report>): boolean {
if (!report) {
return false;
}
// If this policy isn't owned by Expensify,
// Account manager/guide should not have the workspace join request pinned to their LHN,
// since they are not a part of the company, and should not action it on their behalf.
if (report.policyID) {
const policy = getPolicy(report.policyID);
if (!PolicyUtils.isExpensifyTeam(policy.owner) && PolicyUtils.isExpensifyTeam(currentUserPersonalDetails?.login)) {
return false;
}
}
return ReportActionsUtils.isActionableJoinRequestPending(report.reportID);
}

Expand Down
2 changes: 1 addition & 1 deletion src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ function getOptionData({

result.isIOUReportOwner = ReportUtils.isIOUOwnedByCurrentUser(result as Report);

if (ReportActionsUtils.isActionableJoinRequestPending(report.reportID)) {
if (ReportUtils.isJoinRequestInAdminRoom(report)) {
result.isPinned = true;
result.isUnread = true;
result.brickRoadIndicator = CONST.BRICK_ROAD_INDICATOR_STATUS.INFO;
Expand Down

0 comments on commit c647c30

Please sign in to comment.