-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't restrict accessing members for non-public UCRs #30613
Changes from all commits
d4a1eea
f1c7358
f2a7398
6329e16
6a0bf33
211f2e5
e4edb38
949e900
5ecef86
13fb8d0
c61b669
7caf102
c4eac0e
2dc18d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we check here if the user is member of the room here as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No this is handled already by |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ import compose from '@libs/compose'; | |
import Log from '@libs/Log'; | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import * as OptionsListUtils from '@libs/OptionsListUtils'; | ||
import Permissions from '@libs/Permissions'; | ||
import * as PolicyUtils from '@libs/PolicyUtils'; | ||
import * as ReportUtils from '@libs/ReportUtils'; | ||
import * as UserUtils from '@libs/UserUtils'; | ||
|
@@ -31,9 +30,6 @@ import withReportOrNotFound from './home/report/withReportOrNotFound'; | |
import reportPropTypes from './reportPropTypes'; | ||
|
||
const propTypes = { | ||
/** Beta features list */ | ||
betas: PropTypes.arrayOf(PropTypes.string), | ||
|
||
/** The report currently being looked at */ | ||
report: reportPropTypes.isRequired, | ||
|
||
|
@@ -69,7 +65,6 @@ const defaultProps = { | |
}, | ||
report: {}, | ||
policies: {}, | ||
betas: [], | ||
...withCurrentUserPersonalDetailsDefaultProps, | ||
}; | ||
|
||
|
@@ -90,11 +85,6 @@ function RoomMembersPage(props) { | |
}, [props.report.reportID]); | ||
|
||
useEffect(() => { | ||
// Kick the user out if they tried to navigate to this via the URL | ||
if (!PolicyUtils.isPolicyMember(props.report.policyID, props.policies) || !Permissions.canUsePolicyRooms(props.betas)) { | ||
Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(props.report.reportID)); | ||
return; | ||
} | ||
getRoomMembers(); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
|
@@ -247,7 +237,7 @@ function RoomMembersPage(props) { | |
testID={RoomMembersPage.displayName} | ||
> | ||
<FullPageNotFoundView | ||
shouldShow={_.isEmpty(props.report) || !isPolicyMember} | ||
shouldShow={_.isEmpty(props.report) || (ReportUtils.isPublicRoom(props.report) && !isPolicyMember)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if the user is accessing a deep link to a room in which he is neither a member nor part of the workspace? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this is handled by |
||
subtitleKey={_.isEmpty(props.report) ? undefined : 'roomMembersPage.notAuthorized'} | ||
onBackButtonPress={() => Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(props.report.reportID))} | ||
> | ||
|
@@ -322,9 +312,6 @@ export default compose( | |
policies: { | ||
key: ONYXKEYS.COLLECTION.POLICY, | ||
}, | ||
betas: { | ||
key: ONYXKEYS.BETAS, | ||
}, | ||
}), | ||
withCurrentUserPersonalDetails, | ||
)(RoomMembersPage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the order changed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because sometimes the
participants
won't exist if the report is a User Created Policy Room