Removed ability for non admin/mods to view GroupRemovedAccounts page

• Removed:
- ability for non admin/mods to view GroupRemovedAccounts page
This commit is contained in:
mgabdev 2020-12-23 14:47:58 -05:00
parent bdfa42d421
commit 27103b174f
1 changed files with 8 additions and 0 deletions

View File

@ -51,10 +51,17 @@ class GroupRemovedAccounts extends ImmutablePureComponent {
listAccountIds, listAccountIds,
searchAcountIds, searchAcountIds,
hasMore, hasMore,
relationships,
group, group,
} = this.props } = this.props
const { query } = this.state const { query } = this.state
if (!group || !relationships) return <ColumnIndicator type='loading' />
const isAdminOrMod = relationships ? (relationships.get('admin') || relationships.get('moderator')) : false
if (!isAdminOrMod) return <ColumnIndicator type='missing' />
if (!group) return <ColumnIndicator type='loading' /> if (!group) return <ColumnIndicator type='loading' />
const accountIds = !!query ? searchAcountIds : listAccountIds const accountIds = !!query ? searchAcountIds : listAccountIds
@ -107,6 +114,7 @@ const mapStateToProps = (state, { params }) => {
listAccountIds: state.getIn(['user_lists', 'group_removed_accounts', groupId, 'items']), listAccountIds: state.getIn(['user_lists', 'group_removed_accounts', groupId, 'items']),
searchAcountIds: state.getIn(['group_lists', 'removed_search_accounts']), searchAcountIds: state.getIn(['group_lists', 'removed_search_accounts']),
hasMore: !!state.getIn(['user_lists', 'group_removed_accounts', groupId, 'next']), hasMore: !!state.getIn(['user_lists', 'group_removed_accounts', groupId, 'next']),
relationships: state.getIn(['group_relationships', groupId]),
} }
} }