Skip to content

Commit

Permalink
Hide Members option from non-workspace member
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Dec 11, 2023
1 parent 08dd877 commit 8ce8eb3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/ReportDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ function ReportDetailsPage(props) {
return items;
}

if ((!isUserCreatedPolicyRoom && participants.length) || (isUserCreatedPolicyRoom && (!ReportUtils.isPublicRoom(props.report) || isPolicyMember))) {
// The Members page is only shown when:
// - The report is not a user created room with participants to show i.e. DM, Group Chat, etc
// - The report is a user created room and the room and the current user is a workspace member i.e. non-workspace members should not see this option.
if ((!isUserCreatedPolicyRoom && participants.length) || (isUserCreatedPolicyRoom && isPolicyMember)) {
items.push({
key: CONST.REPORT_DETAILS_MENU_ITEM.MEMBERS,
translationKey: 'common.members',
Expand Down

0 comments on commit 8ce8eb3

Please sign in to comment.