From 27103b174fff8a8c1fd5094c6dc121d1cb321a9c Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Wed, 23 Dec 2020 14:47:58 -0500 Subject: [PATCH] Removed ability for non admin/mods to view GroupRemovedAccounts page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Removed: - ability for non admin/mods to view GroupRemovedAccounts page --- .../gabsocial/features/group_removed_accounts.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/javascript/gabsocial/features/group_removed_accounts.js b/app/javascript/gabsocial/features/group_removed_accounts.js index 1f0e4e76..70389ed4 100644 --- a/app/javascript/gabsocial/features/group_removed_accounts.js +++ b/app/javascript/gabsocial/features/group_removed_accounts.js @@ -51,10 +51,17 @@ class GroupRemovedAccounts extends ImmutablePureComponent { listAccountIds, searchAcountIds, hasMore, + relationships, group, } = this.props const { query } = this.state + if (!group || !relationships) return + + const isAdminOrMod = relationships ? (relationships.get('admin') || relationships.get('moderator')) : false + + if (!isAdminOrMod) return + if (!group) return const accountIds = !!query ? searchAcountIds : listAccountIds @@ -107,6 +114,7 @@ const mapStateToProps = (state, { params }) => { listAccountIds: state.getIn(['user_lists', 'group_removed_accounts', groupId, 'items']), searchAcountIds: state.getIn(['group_lists', 'removed_search_accounts']), hasMore: !!state.getIn(['user_lists', 'group_removed_accounts', groupId, 'next']), + relationships: state.getIn(['group_relationships', groupId]), } }