bulk update requests: allow admins to edit forum topic/post ids (#3554).

This commit is contained in:
evazion
2018-02-18 13:08:53 -06:00
parent f07aa1b170
commit 4bc5cc8ccd
2 changed files with 5 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ class BulkUpdateRequestsController < ApplicationController
def bur_params(context)
permitted_params = %i[script skip_secondary_validations]
permitted_params += %i[title reason forum_topic_id] if context == :create
permitted_params += %i[forum_topic_id forum_post_id] if context == :update && CurrentUser.is_admin?
params.require(:bulk_update_request).permit(permitted_params)
end

View File

@@ -37,7 +37,11 @@ category tag_name -> category_name
<% if @bulk_update_request.new_record? %>
<%= f.input :forum_topic_id, :hint => " (optional)" %>
<% elsif @bulk_update_request.persisted? && CurrentUser.is_admin? %>
<%= f.input :forum_topic_id %>
<%= f.input :forum_post_id %>
<% end %>
<%= f.button :submit, :value => "Submit", :data => { :disable_with => "Submitting..." } %>
<%= dtext_preview_button "bulk_update_request", "reason" %>
<% end %>