From: Anton Khorev Date: Tue, 3 Sep 2024 01:05:57 +0000 (+0300) Subject: Remove OAuth 1 ApiCapability user branch X-Git-Tag: live~267^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/ccc70fb914a4f565d2f637e2202df76dffe77a50?ds=sidebyside;hp=-c Remove OAuth 1 ApiCapability user branch --- ccc70fb914a4f565d2f637e2202df76dffe77a50 diff --git a/app/abilities/api_capability.rb b/app/abilities/api_capability.rb index 44e676345..2035afff9 100644 --- a/app/abilities/api_capability.rb +++ b/app/abilities/api_capability.rb @@ -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)