]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/permissions_controller.rb
Merge remote-tracking branch 'upstream/pull/5140'
[rails.git] / app / controllers / api / permissions_controller.rb
index 717bbfa6f7fd1c23428c9d952b1e18d55ef5032b..d7fb92ae6aebc9531afd7b6a2a159a8812a3b3f0 100644 (file)
@@ -14,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