FIX: rate limit user posts export

This commit is contained in:
Arpit Jalan
2014-12-30 18:07:05 +05:30
parent f7955406cc
commit 78537aad39
6 changed files with 28 additions and 8 deletions

View File

@@ -5,9 +5,7 @@ class ExportCsvController < ApplicationController
def export_entity
params.require(:entity)
params.require(:entity_type)
if params[:entity_type] == "admin"
guardian.ensure_can_export_admin_entity!(current_user)
end
guardian.ensure_can_export_entity!(params[:entity_type])
Jobs.enqueue(:export_csv_file, entity: params[:entity], user_id: current_user.id)
render json: success_json