Allow admins access to comment delete

This commit is contained in:
Paul Kaplan 2018-10-17 13:16:41 -04:00
parent 242f01118b
commit 7b514344fa
2 changed files with 4 additions and 1 deletions

View file

@ -45,6 +45,7 @@ const PreviewPresentation = ({
assetHost,
backpackOptions,
canAddToStudio,
canDeleteComments,
canReport,
canRestoreComments,
comments,
@ -364,7 +365,7 @@ const PreviewPresentation = ({
{comments.map(comment => (
<TopLevelComment
author={comment.author}
canDelete={userOwnsProject}
canDelete={canDeleteComments}
canReply={isLoggedIn && projectInfo.comments_allowed}
canRestore={canRestoreComments}
content={comment.content}
@ -412,6 +413,7 @@ PreviewPresentation.propTypes = {
visible: PropTypes.bool
}),
canAddToStudio: PropTypes.bool,
canDeleteComments: PropTypes.bool,
canReport: PropTypes.bool,
canRestoreComments: PropTypes.bool,
comments: PropTypes.arrayOf(PropTypes.object),

View file

@ -350,6 +350,7 @@ class Preview extends React.Component {
assetHost={this.props.assetHost}
backpackOptions={this.props.backpackOptions}
canAddToStudio={this.props.canAddToStudio}
canDeleteComments={this.props.isAdmin || this.props.userOwnsProject}
canReport={this.props.canReport}
canRestoreComments={this.props.isAdmin}
comments={this.props.comments}