X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0eb2afa83aee217fc2c6399bd23d0d8152c09eb5..75bde83a138226179059551e386561640adc285d:/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