Class: Steppe::Auth::Bearer::HashTokenStore::AccessToken

Inherits:
Object
  • Object
show all
Defined in:
lib/steppe/auth/bearer.rb

Overview

Represents an access token with associated permission scopes.

Instance Method Summary collapse

Instance Method Details

#allows?(required_scopes) ⇒ Boolean

Check if this token has any of the required scopes.

Parameters:

  • required_scopes (Array<String>)

    Scopes to check against

Returns:

  • (Boolean)

    True if token has at least one required scope



50
51
52
# File 'lib/steppe/auth/bearer.rb', line 50

def allows?(required_scopes)
  (scopes & required_scopes).any?
end