Class: Zaikio::OAuthClient::ClientConfiguration::OrganizationConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/zaikio/oauth_client/client_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOrganizationConnection

Returns a new instance of OrganizationConnection.



54
55
56
# File 'lib/zaikio/oauth_client/client_configuration.rb', line 54

def initialize
  @default_scopes = []
end

Instance Attribute Details

#default_scopesObject

Returns the value of attribute default_scopes.



52
53
54
# File 'lib/zaikio/oauth_client/client_configuration.rb', line 52

def default_scopes
  @default_scopes
end

Instance Method Details

#scopes_for_auth(id = nil) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/zaikio/oauth_client/client_configuration.rb', line 58

def scopes_for_auth(id = nil)
  plain_scopes = Zaikio::OAuthClient.get_plain_scopes(default_scopes)

  plain_scopes.map do |scope|
    id ? "Org/#{id}.#{scope}" : "Org.#{scope}"
  end
end