]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/permissions_controller.rb
Drop support for OAuth 1
[rails.git] / app / controllers / api / permissions_controller.rb
index 8c0c949dc2c71302f64b1611f2977961a71d7718..d7fb92ae6aebc9531afd7b6a2a159a8812a3b3f0 100644 (file)
@@ -1,7 +1,5 @@
 module Api
   class PermissionsController < ApiController
-    before_action :check_api_readable
-
     authorize_resource :class => false
 
     before_action :setup_user_auth
@@ -16,10 +14,8 @@ module Api
     def show
       @permissions = if doorkeeper_token.present?
                        doorkeeper_token.scopes.map { |s| :"allow_#{s}" }
-                     elsif current_token.present?
-                       ClientApplication.all_permissions.select { |p| current_token.read_attribute(p) }
                      elsif current_user
-                       ClientApplication.all_permissions
+                       Oauth.scopes.map { |s| :"allow_#{s.name}" }
                      else
                        []
                      end