]> git.openstreetmap.org Git - rails.git/commitdiff
Remove OAuth 1 ApiCapability user branch
authorAnton Khorev <tony29@yandex.ru>
Tue, 3 Sep 2024 01:05:57 +0000 (04:05 +0300)
committerAnton Khorev <tony29@yandex.ru>
Thu, 5 Sep 2024 20:16:01 +0000 (23:16 +0300)
app/abilities/api_capability.rb

index 44e67634552599c861f9320209e8a7810a155edd..2035afff991690cbd3a507dfe4962ca4bf92887a 100644 (file)
@@ -5,11 +5,7 @@ class ApiCapability
 
   def initialize(token)
     if Settings.status != "database_offline"
-      user = if token.respond_to?(:resource_owner_id)
-               User.find(token.resource_owner_id)
-             elsif token.respond_to?(:user)
-               token.user
-             end
+      user = (User.find(token.resource_owner_id) if token.respond_to?(:resource_owner_id))
 
       if user&.active?
         can [:create, :comment, :close, :reopen], Note if scope?(token, :write_notes)