Sha256: d1fada2c231144cf90dcd830e4874cae7bc6278d14cdb7b52e76fd1d9b42854b

Contents?: true

Size: 829 Bytes

Versions: 11

Compression:

Stored size: 829 Bytes

Contents

require "cfoundry/v2/model"

module CFoundry::V2
  class Organization < Model
    attribute :name, :string
    attribute :billing_enabled, :boolean
    attribute :status, :string

    to_many   :spaces
    to_many   :domains
    to_many   :users
    to_many   :managers, :as => :user
    to_many   :billing_managers, :as => :user
    to_many   :auditors, :as => :user

    to_one    :quota_definition

    queryable_by :name, :space_guid, :user_guid, :manager_guid,
      :billing_manager_guid, :auditor_guid

    def delete_user_from_all_roles(user)
      remove_user(user)
      remove_manager(user)
      remove_billing_manager(user)
      remove_auditor(user)

      spaces.each do |space|
        space.remove_developer(user)
        space.remove_auditor(user)
        space.remove_manager(user)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cfoundry-4.7.2.rc1 lib/cfoundry/v2/organization.rb
cfoundry-4.7.1 lib/cfoundry/v2/organization.rb
cfoundry-4.7.1.rc1 lib/cfoundry/v2/organization.rb
cfoundry-4.7.0 lib/cfoundry/v2/organization.rb
cfoundry-4.6.3.rc3 lib/cfoundry/v2/organization.rb
cfoundry-4.6.3.rc2 lib/cfoundry/v2/organization.rb
cfoundry-4.6.3.rc1 lib/cfoundry/v2/organization.rb
cfoundry-4.6.2 lib/cfoundry/v2/organization.rb
cfoundry-4.6.1 lib/cfoundry/v2/organization.rb
cfoundry-4.6.0 lib/cfoundry/v2/organization.rb
cfoundry-4.5.3 lib/cfoundry/v2/organization.rb