From f8f882fbfd2372fde4253756955a37c90eb50953 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 30 Jan 2018 11:00:48 -0700 Subject: [PATCH] blocked user actions in username change process --- .../src/components/CommentLabels.js | 3 ++- .../src/routes/Community/components/People.js | 14 +++++++---- .../coral-embed-stream/src/graphql/index.js | 3 ++- .../src/tabs/stream/components/Comment.js | 5 ++-- client/coral-framework/constants/roles.js | 4 ++++ .../constants/usernameStatus.js | 22 +++++++++++++++++ client/coral-framework/services/perms.js | 24 ++++++++++++------- 7 files changed, 58 insertions(+), 17 deletions(-) create mode 100644 client/coral-framework/constants/roles.js create mode 100644 client/coral-framework/constants/usernameStatus.js diff --git a/client/coral-admin/src/components/CommentLabels.js b/client/coral-admin/src/components/CommentLabels.js index e50d53632..8eac152bd 100644 --- a/client/coral-admin/src/components/CommentLabels.js +++ b/client/coral-admin/src/components/CommentLabels.js @@ -5,8 +5,9 @@ import Slot from 'coral-framework/components/Slot'; import FlagLabel from 'coral-ui/components/FlagLabel'; import cn from 'classnames'; import styles from './CommentLabels.css'; +import { ADMIN, MODERATOR, STAFF } from 'coral-framework/constants/roles'; -const staffRoles = ['ADMIN', 'STAFF', 'MODERATOR']; +const staffRoles = [ADMIN, MODERATOR, STAFF]; function isUserFlagged(actions) { return actions.some( diff --git a/client/coral-admin/src/routes/Community/components/People.js b/client/coral-admin/src/routes/Community/components/People.js index 0328d148b..1f5e4bab8 100644 --- a/client/coral-admin/src/routes/Community/components/People.js +++ b/client/coral-admin/src/routes/Community/components/People.js @@ -10,6 +10,12 @@ import ActionsMenu from 'coral-admin/src/components/ActionsMenu'; import ActionsMenuItem from 'coral-admin/src/components/ActionsMenuItem'; import { isSuspended, isBanned } from 'coral-framework/utils/user'; import moment from 'moment'; +import { + ADMIN, + COMMENTER, + MODERATOR, + STAFF, +} from 'coral-framework/constants/roles'; const headers = [ { @@ -200,19 +206,19 @@ class People extends React.Component { onChange={role => setUserRole(user.id, role)} >