Skip to content

Commit

Permalink
Merge pull request #32857 from Expensify/marcaaron-hideMembersList
Browse files Browse the repository at this point in the history
Hide Members option from non-workspace member
  • Loading branch information
marcaaron authored Dec 13, 2023
2 parents 89bdaed + ed8db59 commit 7f7cfb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion src/pages/RoomMembersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function RoomMembersPage(props) {
testID={RoomMembersPage.displayName}
>
<FullPageNotFoundView
shouldShow={_.isEmpty(props.report) || (ReportUtils.isPublicRoom(props.report) && !isPolicyMember)}
shouldShow={_.isEmpty(props.report) || !isPolicyMember}
subtitleKey={_.isEmpty(props.report) ? undefined : 'roomMembersPage.notAuthorized'}
onBackButtonPress={() => Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(props.report.reportID))}
>
Expand Down

0 comments on commit 7f7cfb3

Please sign in to comment.