mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 12:17:30 +02:00
27 lines
712 B
Ruby
27 lines
712 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Admin
|
|
class MassActionsController < BaseController
|
|
before_action :authorize_admin
|
|
|
|
# GET /admin/mass_actions
|
|
def index; end
|
|
|
|
# POST /admin/mass_actions
|
|
def create
|
|
res = MassAction.process(params[:mass_action], params[:entry_list].path)
|
|
notice = if res
|
|
"#{params[:mass_action]} completed for #{res[:ok]}.\n" \
|
|
"Failed: #{res[:fail]}"
|
|
else
|
|
"Dataset integrity validation failed for #{params[:mass_action]}"
|
|
end
|
|
|
|
redirect_to(admin_mass_actions_path, notice: notice)
|
|
end
|
|
|
|
def authorize_admin
|
|
authorize! :manage, :mass_actions
|
|
end
|
|
end
|
|
end
|