Restrict post replacements to mod+ (issue #3348)

This commit is contained in:
Type-kun
2017-11-01 13:19:52 +05:00
parent e243648b91
commit af7c109912
2 changed files with 2 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
class PostReplacementsController < ApplicationController
respond_to :html, :xml, :json
before_filter :approver_only, except: [:index]
before_filter :moderator_only, except: [:index]
def new
@post = Post.find(params[:post_id])

View File

@@ -55,9 +55,8 @@
<li><%= link_to "Expunge", expunge_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "expunge", :data => {:confirm => "This will permanently delete this post (meaning the file will be deleted). Are you sure you want to delete this post?"} %></li>
<% end %>
<li><%= link_to "Replace Image", new_post_replacement_path(:post_id => post.id), :id => "replace-image" %></li>
<% if CurrentUser.is_moderator? %>
<li><%= link_to "Replace Image", new_post_replacement_path(:post_id => post.id), :id => "replace-image" %></li>
<li><%= link_to "Down vote report", reports_down_voting_post_path(post_id: post.id) %></li>
<% end %>
<% end %>