X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/12c1d5e6c05813a0697724277b4d8529a1a7c240..8d7b98a618cd381a0aa1de578b4af9421634c308:/app/models/oauth2_application.rb diff --git a/app/models/oauth2_application.rb b/app/models/oauth2_application.rb index 165761520..73a02417d 100644 --- a/app/models/oauth2_application.rb +++ b/app/models/oauth2_application.rb @@ -3,6 +3,10 @@ class Oauth2Application < Doorkeeper::Application validate :allowed_scopes + def authorized_scopes_for(user) + authorized_tokens.where(:resource_owner_id => user).sum(Doorkeeper::OAuth::Scopes.new, &:scopes) + end + private def allowed_scopes