]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Add a privileged scope that allows email addresses to be returned
[rails.git] / app / controllers / application_controller.rb
index 0884964edffbd3498b6f6466626e4e8e78203dff..517b11e140818818dd7ab16b7219a39f04337720 100644 (file)
@@ -395,4 +395,10 @@ class ApplicationController < ActionController::Base
 
     referer.to_s
   end
+
+  def scope_enabled?(scope)
+    doorkeeper_token&.includes_scope?(scope) || current_token&.includes_scope?(scope)
+  end
+
+  helper_method :scope_enabled?
 end