Class: Aptible::Auth::Organization
- Defined in:
- lib/aptible/auth/organization.rb
Instance Method Summary collapse
- #accounts ⇒ Object
- #billing_detail ⇒ Object
- #can_manage_compliance? ⇒ Boolean
- #privileged_roles ⇒ Object
Methods inherited from Resource
Instance Method Details
#accounts ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/aptible/auth/organization.rb', line 41 def accounts return @accounts if @accounts require 'aptible/api' accounts = Aptible::Api::Account.all(token: token, headers: headers) @accounts = accounts.select do |account| (link = account.links[:organization]) && link.href == href end end |
#billing_detail ⇒ Object
26 27 28 29 30 |
# File 'lib/aptible/auth/organization.rb', line 26 def billing_detail @billing_detail ||= Aptible::Billing::BillingDetail.find( id, token: token, headers: headers ) end |
#can_manage_compliance? ⇒ Boolean
32 33 34 35 |
# File 'lib/aptible/auth/organization.rb', line 32 def can_manage_compliance? return false unless billing_detail %w(production pilot).include?(billing_detail.plan) end |
#privileged_roles ⇒ Object
37 38 39 |
# File 'lib/aptible/auth/organization.rb', line 37 def privileged_roles roles.select(&:privileged?) end |