From: Anton Khorev Date: Fri, 24 Jan 2025 02:56:23 +0000 (+0300) Subject: Move scope_enabled? to ApiController X-Git-Tag: live~360^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/47a8907e2a622804ac400be8f4e7ec611f006c87?ds=sidebyside;hp=--cc Move scope_enabled? to ApiController --- 47a8907e2a622804ac400be8f4e7ec611f006c87 diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 5a112b3cf..23f35a40e 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -170,4 +170,10 @@ class ApiController < ApplicationController raise OSM::APIRateLimitExceeded if new_changes > max_changes end + + def scope_enabled?(scope) + doorkeeper_token&.includes_scope?(scope) + end + + helper_method :scope_enabled? end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f6006fe5e..40f02300a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -354,10 +354,4 @@ class ApplicationController < ActionController::Base referer&.to_s end - - def scope_enabled?(scope) - doorkeeper_token&.includes_scope?(scope) - end - - helper_method :scope_enabled? end