DEV: Add plugin api to permit bulk_action parameters (#10638)
This commit is contained in:
parent
296c707f55
commit
ddab7cc239
|
@ -868,7 +868,7 @@ class TopicsController < ApplicationController
|
|||
|
||||
operation = params
|
||||
.require(:operation)
|
||||
.permit(:type, :group, :category_id, :notification_level_id, tags: [])
|
||||
.permit(:type, :group, :category_id, :notification_level_id, *DiscoursePluginRegistry.permitted_bulk_action_parameters, tags: [])
|
||||
.to_h.symbolize_keys
|
||||
|
||||
raise ActionController::ParameterMissing.new(:operation_type) if operation[:type].blank?
|
||||
|
|
|
@ -82,6 +82,8 @@ class DiscoursePluginRegistry
|
|||
define_filtered_register :api_parameter_routes
|
||||
define_filtered_register :api_key_scope_mappings
|
||||
|
||||
define_filtered_register :permitted_bulk_action_parameters
|
||||
|
||||
def self.register_auth_provider(auth_provider)
|
||||
self.auth_providers << auth_provider
|
||||
end
|
||||
|
|
|
@ -899,4 +899,8 @@ class Plugin::Instance
|
|||
end
|
||||
nil
|
||||
end
|
||||
|
||||
def register_permitted_bulk_action_parameter(name)
|
||||
DiscoursePluginRegistry.register_permitted_bulk_action_parameter(name, self)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue