Class: OnSIP::User
Defined Under Namespace
Modules: ClassMethods
Constant Summary
ClassMethods::DEFAULT_OPTIONS
Model::ClassMethods::DEFAULT_OPTIONS
Instance Attribute Summary
Attributes included from Model
#attributes, #session
Instance Method Summary
collapse
browse, edit_status, generate_random_password, process_add_user_response, process_browse_user_response, process_change_role_user_response, process_delete_user_response, process_edit_user_status_response, process_read_user_response, read
#merge_params
Methods included from Model
#initialize
Instance Method Details
#account ⇒ Object
37
38
39
|
# File 'lib/onsip/models/user.rb', line 37
def account
Account.read self.account_id
end
|
#account_id ⇒ Object
9
10
11
|
# File 'lib/onsip/models/user.rb', line 9
def account_id
@attributes.AccountId
end
|
#add(organization = nil) ⇒ Object
41
42
43
|
# File 'lib/onsip/models/user.rb', line 41
def add(organization = nil)
self.class.add organization, @attributes
end
|
#auth_username ⇒ Object
33
34
35
|
# File 'lib/onsip/models/user.rb', line 33
def auth_username
@attributes.AuthUsername
end
|
#change_role(role) ⇒ Object
57
58
59
|
# File 'lib/onsip/models/user.rb', line 57
def change_role(role)
self.class.change_role self.id, role
end
|
#delete! ⇒ Object
45
46
47
|
# File 'lib/onsip/models/user.rb', line 45
def delete!
self.class.delete! self.id
end
|
#disable! ⇒ Object
61
62
63
|
# File 'lib/onsip/models/user.rb', line 61
def disable!
self.class.edit_status self.id, {'Status' => 'disabled'}
end
|
#domain ⇒ Object
21
22
23
|
# File 'lib/onsip/models/user.rb', line 21
def domain
@attributes.Domain
end
|
#id ⇒ Object
5
6
7
|
# File 'lib/onsip/models/user.rb', line 5
def id
@attributes.UserId
end
|
#organization ⇒ Object
49
50
51
|
# File 'lib/onsip/models/user.rb', line 49
def organization
@organization ||= Organization.read(self.organization_id)
end
|
#organization_id ⇒ Object
13
14
15
|
# File 'lib/onsip/models/user.rb', line 13
def organization_id
@attributes.OrganizationId
end
|
#password ⇒ Object
29
30
31
|
# File 'lib/onsip/models/user.rb', line 29
def password
@attributes.Password
end
|
#status ⇒ Object
17
18
19
|
# File 'lib/onsip/models/user.rb', line 17
def status
@attributes.Status
end
|
#user_addresses ⇒ Object
53
54
55
|
# File 'lib/onsip/models/user.rb', line 53
def user_addresses
UserAddress.browse({'UserId' => self.id})
end
|
#username ⇒ Object
25
26
27
|
# File 'lib/onsip/models/user.rb', line 25
def username
@attributes.Username
end
|