Class: CFoundry::V2::Organization

Inherits:
Model
  • Object
show all
Defined in:
lib/cfoundry/v2/organization.rb

Instance Attribute Summary

Attributes inherited from Model

#cache, #changes, #created_at, #diff, #guid, #updated_at

Attributes included from ModelMagic

#scoped_organization, #scoped_space

Instance Method Summary collapse

Methods inherited from Model

#attribute_for_error, #changed?, #create, #create!, #create_endpoint_name, #delete, #delete!, #eql?, #exists?, #hash, inherited, #initialize, #inspect, #invalidate!, #manifest, #object_name, objects, #partial?, #persisted?, #plural_object_name, #query_target, #to_key, #to_param, #update!

Methods included from ModelMagic

#attributes, #defaults, #inherited, #object_name, params_from, #plural_object_name, query_from_hash, #scoped_to_organization, #scoped_to_space, #to_many_relations, #to_one_relations

Methods included from ModelMagic::QueryableBy

#queryable_by

Methods included from ModelMagic::ToMany

#to_many

Methods included from ModelMagic::ToOne

#to_one

Methods included from ModelMagic::Attribute

#attribute

Methods included from ModelMagic::HasSummary

#has_summary

Methods included from ModelMagic::ClientExtensions

#add_client_methods

Constructor Details

This class inherits a constructor from CFoundry::V2::Model

Instance Method Details

#delete_user_from_all_roles(user) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/cfoundry/v2/organization.rb', line 21

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