summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authornickago <ngonella@calpoly.edu>2015-07-14 13:09:14 -0700
committernickago <ngonella@calpoly.edu>2015-07-14 13:09:14 -0700
commitcb2bff28ee7a43b3d3c52d3c448d3f15d12830ba (patch)
tree21092457226138a45b0faff3743dd367475e25d1 /web
parentb31327f072aa575d5ff97cc5e0786e50510ab456 (diff)
downloadchat-cb2bff28ee7a43b3d3c52d3c448d3f15d12830ba.tar.gz
chat-cb2bff28ee7a43b3d3c52d3c448d3f15d12830ba.tar.bz2
chat-cb2bff28ee7a43b3d3c52d3c448d3f15d12830ba.zip
Team admin can now delete any post
Diffstat (limited to 'web')
-rw-r--r--web/react/components/post_info.jsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx
index cf01747f0..48efa95ba 100644
--- a/web/react/components/post_info.jsx
+++ b/web/react/components/post_info.jsx
@@ -11,6 +11,7 @@ module.exports = React.createClass({
render: function() {
var post = this.props.post;
var isOwner = UserStore.getCurrentId() == post.user_id;
+ var isAdmin = UserStore.getCurrentUser().roles.indexOf("admin") > -1
var type = "Post"
if (post.root_id.length > 0) {
@@ -36,7 +37,7 @@ module.exports = React.createClass({
<ul className="dropdown-menu" role="menu">
{ isOwner ? <li role="presentation"><a href="#" role="menuitem" data-toggle="modal" data-target="#edit_post" data-title={type} data-message={post.message} data-postid={post.id} data-channelid={post.channel_id} data-comments={type === "Post" ? this.props.commentCount : 0}>Edit</a></li>
: "" }
- { isOwner ? <li role="presentation"><a href="#" role="menuitem" data-toggle="modal" data-target="#delete_post" data-title={type} data-postid={post.id} data-channelid={post.channel_id} data-comments={type === "Post" ? this.props.commentCount : 0}>Delete</a></li>
+ { isOwner || isAdmin ? <li role="presentation"><a href="#" role="menuitem" data-toggle="modal" data-target="#delete_post" data-title={type} data-postid={post.id} data-channelid={post.channel_id} data-comments={type === "Post" ? this.props.commentCount : 0}>Delete</a></li>
: "" }
{ this.props.allowReply === "true" ? <li role="presentation"><a className="reply-link theme" href="#" onClick={this.props.handleCommentClick}>Reply</a></li>
: "" }