X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6c6e8883f703efe8e05d893a94c169ac90733d42..75bde83a138226179059551e386561640adc285d:/app/models/oauth2_application.rb?ds=sidebyside 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