]> git.openstreetmap.org Git - rails.git/blob - app/models/oauth2_application.rb
Bump eslint from 8.38.0 to 8.39.0
[rails.git] / app / models / oauth2_application.rb
1 class Oauth2Application < Doorkeeper::Application
2   belongs_to :owner, :polymorphic => true
3
4   validate :allowed_scopes
5
6   private
7
8   def allowed_scopes
9     return if owner.administrator?
10
11     errors.add(:scopes) if scopes.any? { |scope| Oauth::PRIVILEGED_SCOPES.include?(scope) }
12   end
13 end