diff --git a/app/controllers/clients_controller.rb b/app/controllers/clients_controller.rb index 71551621c..951439357 100644 --- a/app/controllers/clients_controller.rb +++ b/app/controllers/clients_controller.rb @@ -145,7 +145,7 @@ def totals page = { size: 0, number: 1} response = nil bmt = Benchmark.ms { - state = authenticate_user!.present? && authenticate_user!.is_admin? && params[:state].present? ? params[:state] : "registered,findable" + state = current_user.present? && current_user.is_admin_or_staff? && params[:state].present? ? params[:state] : "registered,findable" response = Doi.query(nil, provider_id: params[:provider_id], state: state, page: page, totals_agg: true) } if bmt > 10000 diff --git a/app/controllers/providers_controller.rb b/app/controllers/providers_controller.rb index 5c6eadc2b..ca1c9c044 100644 --- a/app/controllers/providers_controller.rb +++ b/app/controllers/providers_controller.rb @@ -201,7 +201,7 @@ def totals page = { size: 0, number: 1 } response = nil bmt = Benchmark.ms { - state = authenticate_user!.present? && authenticate_user!.is_admin? && params[:state].present? ? params[:state] : "registered,findable" + state = current_user.present? && current_user.is_admin_or_staff? && params[:state].present? ? params[:state] : "registered,findable" response = Doi.query(nil, state: state, page: page, totals_agg: true) }