X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/869d86a31fbc7982ba237c51ba4400f3ad148981..1ddcfca371825a12b53cacf99f8e7c2154b9ecb5:/app/abilities/api_capability.rb diff --git a/app/abilities/api_capability.rb b/app/abilities/api_capability.rb index 44e676345..07345d254 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 user&.active? can [:create, :comment, :close, :reopen], Note if scope?(token, :write_notes)