]> git.openstreetmap.org Git - rails.git/commitdiff
Move scope_enabled? to ApiController
authorAnton Khorev <tony29@yandex.ru>
Fri, 24 Jan 2025 02:56:23 +0000 (05:56 +0300)
committerAnton Khorev <tony29@yandex.ru>
Fri, 24 Jan 2025 02:56:23 +0000 (05:56 +0300)
app/controllers/api_controller.rb
app/controllers/application_controller.rb

index 5a112b3cf61c4e4e35605b16086cf7bef6a6cc3e..23f35a40eeaf73662765d1d8cf137f2605f40f9c 100644 (file)
@@ -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
index f6006fe5e4ccdc7139a6db14d5e0cf7adf5ee748..40f02300a469f4d6bc14373b4fe79c9d19fa172b 100644 (file)
@@ -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