diff --git a/client/coral-admin/src/components/ui/Header.js b/client/coral-admin/src/components/ui/Header.js index 38797a7c3..181bfe688 100644 --- a/client/coral-admin/src/components/ui/Header.js +++ b/client/coral-admin/src/components/ui/Header.js @@ -10,59 +10,61 @@ import {can} from 'coral-framework/utils/roles'; const CoralHeader = ({ handleLogout, showShortcuts = () => {}, - restricted = false, auth }) => (
- { - !restricted ?
- - - {lang.t('configure.dashboard')} - - { - auth && auth.user && can(auth.user, 'MODERATE_COMMENTS') && ( - - {lang.t('configure.moderate')} - - ) - } - - {lang.t('configure.stories')} - - - {lang.t('configure.community')} - - { - auth && auth.user && can(auth.user, 'UPDATE_CONFIG') && ( - - {lang.t('configure.configure')} - - ) - } - + { + auth && auth.user && can(auth.user, 'ACCESS_ADMIN') ? + + + {lang.t('configure.dashboard')} + + { + auth && auth.user && can(auth.user, 'MODERATE_COMMENTS') && ( + + {lang.t('configure.moderate')} + + ) + } + + {lang.t('configure.stories')} + + + {lang.t('configure.community')} + + { + auth && auth.user && can(auth.user, 'UPDATE_CONFIG') && ( + + {lang.t('configure.configure')} + + ) + } + + : + null + }
  • @@ -80,17 +82,13 @@ const CoralHeader = ({
- : - null - }
); CoralHeader.propTypes = { auth: PropTypes.object, showShortcuts: PropTypes.func, - handleLogout: PropTypes.func.isRequired, - restricted: PropTypes.bool // hide elemnts from a user that's logged out + handleLogout: PropTypes.func.isRequired }; const lang = new I18n(translations); diff --git a/client/coral-admin/src/containers/Configure/Configure.js b/client/coral-admin/src/containers/Configure/Configure.js index 44c38cd50..79dd76cc5 100644 --- a/client/coral-admin/src/containers/Configure/Configure.js +++ b/client/coral-admin/src/containers/Configure/Configure.js @@ -119,7 +119,7 @@ class Configure extends Component { render () { const {activeSection} = this.state; const section = this.getSection(activeSection); - const {auth: user} = this.props; + const {auth: {user}} = this.props; if (!can(user, 'UPDATE_CONFIG')) { return

You must be an administrator to access config settings. Please find the nearest Admin and ask them to level you up!

; diff --git a/client/coral-admin/src/containers/LayoutContainer.js b/client/coral-admin/src/containers/LayoutContainer.js index adeb8a346..14376b390 100644 --- a/client/coral-admin/src/containers/LayoutContainer.js +++ b/client/coral-admin/src/containers/LayoutContainer.js @@ -57,7 +57,7 @@ class LayoutContainer extends Component { } else if (loggedIn) { return ( -

This page is for team use only. Please contact an administrator if you want to join this team.

; +

This page is for team use only. Please contact an administrator if you want to join this team.

); }