From ccc70fb914a4f565d2f637e2202df76dffe77a50 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Tue, 3 Sep 2024 04:05:57 +0300 Subject: [PATCH] Remove OAuth 1 ApiCapability user branch --- app/abilities/api_capability.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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) -- 2.39.5