debian-mirror-gitlab/doorkeeper/lib/doorkeeper/models/concerns/scopes.rb
2020-01-04 02:51:38 +05:30

17 lines
344 B
Ruby

module Doorkeeper
module Models
module Scopes
def scopes
OAuth::Scopes.from_string(self[:scopes])
end
def scopes_string
self[:scopes]
end
def includes_scope?(*required_scopes)
required_scopes.blank? || required_scopes.any? { |s| scopes.exists?(s.to_s) }
end
end
end
end