Module: Doorkeeper::Models::Scopes

Included in:
AccessGrantMixin, AccessTokenMixin, ApplicationMixin
Defined in:
lib/doorkeeper/models/concerns/scopes.rb

Instance Method Summary collapse

Instance Method Details

#includes_scope?(*required_scopes) ⇒ Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/doorkeeper/models/concerns/scopes.rb', line 12

def includes_scope?(*required_scopes)
  required_scopes.blank? || required_scopes.any? { |s| scopes.exists?(s.to_s) }
end

#scopesObject


4
5
6
# File 'lib/doorkeeper/models/concerns/scopes.rb', line 4

def scopes
  OAuth::Scopes.from_string(self[:scopes])
end

#scopes_stringObject


8
9
10
# File 'lib/doorkeeper/models/concerns/scopes.rb', line 8

def scopes_string
  self[:scopes]
end