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