bulk update requests: allow admins to edit forum topic/post ids (#3554).
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
Reference in New Issue
Block a user