diff --git a/frontend/src/containers/User/index.js b/frontend/src/containers/User/index.js index e5ed2464..5059d3c3 100644 --- a/frontend/src/containers/User/index.js +++ b/frontend/src/containers/User/index.js @@ -64,6 +64,9 @@ export class UserPage extends Component { render() { const { user } = this.props + const isAdmin = Boolean( + ((user || {}).roles || []) + .find(role => role.role === 'admin')) const unitManagers = this.props.managers.filter(manager => manager.programmeId === parseInt(this.state.programmeId, 10)) const isStaff = user && ((user.roles && user.roles.length > 0) || @@ -88,7 +91,7 @@ export class UserPage extends Component { )} - {process.env.NODE_ENV !== 'production' ? + {process.env.NODE_ENV !== 'production' || isAdmin ? { }) } -const isDevEnv = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'staging' +const isDevEnv = process.env.NODE_ENV === 'development' const devDefaultOptions = { headers: {