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

View file

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