fix saving to gallery and only allow admins
This commit is contained in:
parent
a969727a48
commit
d3cac65b97
@ -153,7 +153,7 @@ class ProjectHome extends Component {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Link>
|
</Link>
|
||||||
{this.props.user &&
|
{this.props.user &&
|
||||||
this.props.user.email === project.creator ? (
|
(this.props.user.email === project.creator || this.props.user.role === 'admin') ? (
|
||||||
<div>
|
<div>
|
||||||
<Divider
|
<Divider
|
||||||
style={{
|
style={{
|
||||||
|
@ -132,7 +132,7 @@ class SaveProject extends Component {
|
|||||||
<Tooltip title={this.state.projectType === 'project' ? Blockly.Msg.tooltip_update_project : Blockly.Msg.tooltip_save_project} arrow>
|
<Tooltip title={this.state.projectType === 'project' ? Blockly.Msg.tooltip_update_project : Blockly.Msg.tooltip_save_project} arrow>
|
||||||
<IconButton
|
<IconButton
|
||||||
className={this.props.classes.button}
|
className={this.props.classes.button}
|
||||||
onClick={this.props.user.blocklyRole !== 'user' && (!this.props.project || this.props.user.email === this.props.project.creator) ? (e) => this.toggleMenu(e) : this.state.projectType === 'project' ? () => this.props.updateProject(this.state.projectType, this.props.project._id) : () => { this.setState({ projectType: 'project' }, () => this.saveProject()) }}
|
onClick={this.props.user.blocklyRole === 'admin' && (!this.props.project || this.props.user.email === this.props.project.creator) ? (e) => this.toggleMenu(e) : this.state.projectType === 'project' ? () => this.props.updateProject(this.state.projectType, this.props.project._id) : () => { this.setState({ projectType: 'project' }, () => this.saveProject()) }}
|
||||||
size="large">
|
size="large">
|
||||||
<FontAwesomeIcon icon={faSave} size="xs" />
|
<FontAwesomeIcon icon={faSave} size="xs" />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
@ -86,7 +86,7 @@ class WorkspaceFunc extends Component {
|
|||||||
(this.props.projectType === "project" ||
|
(this.props.projectType === "project" ||
|
||||||
this.props.projectType === "gallery") &&
|
this.props.projectType === "gallery") &&
|
||||||
this.props.user &&
|
this.props.user &&
|
||||||
this.props.user.email === this.props.project.creator ? (
|
(this.props.user.email === this.props.project.creator || this.props.user.role === 'admin' ) ? (
|
||||||
<DeleteProject
|
<DeleteProject
|
||||||
project={this.props.project}
|
project={this.props.project}
|
||||||
projectType={this.props.projectType}
|
projectType={this.props.projectType}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user