Class: Aptible::Auth::Organization

Inherits:
Resource
  • Object
show all
Defined in:
lib/aptible/auth/organization.rb

Instance Method Summary collapse

Methods inherited from Resource

#namespace, #root_url

Instance Method Details

#accountsObject



32
33
34
35
36
37
38
39
40
41
# File 'lib/aptible/auth/organization.rb', line 32

def accounts
  return @accounts if @accounts

  require 'aptible/api'

  accounts = Aptible::Api::Account.all(token: token, headers: headers)
  @accounts = accounts.select do ||
    (link = .links[:organization]) && link.href == href
  end
end

#create_saml_configuration!(params) ⇒ Object

SamlConfiguration is a dependent object that does not have a link until created. So, we create the link for it to allow HyperResource to successfully create the object. Afterwords, we can directly manage the SamlConfiguration



47
48
49
50
51
52
# File 'lib/aptible/auth/organization.rb', line 47

def create_saml_configuration!(params)
  HyperResource::Link.new(
    self,
    'href' => "#{href}/saml_configurations"
  ).post(self.class.normalize_params(params))
end

#privileged_rolesObject



28
29
30
# File 'lib/aptible/auth/organization.rb', line 28

def privileged_roles
  roles.select(&:privileged?)
end