X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/550c4a3a45814fde5c809334c85f1ebc47659a82..b45642d2abca834c59e7db1fda512151393c88cc:/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