Class: Zimbra::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/zimbra/account.rb

Constant Summary

Constants inherited from Base

Base::NAMESPACES

Instance Attribute Summary collapse

Attributes inherited from Base

#id, #name, #zimbra_attrs

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#acls, all, class_name, #delete, find_by_id, find_by_name, #modify, #rename, zimbra_attrs_to_load, zimbra_attrs_to_load=, #zimbra_type

Constructor Details

#initialize(id, name, zimbra_attrs = {}, node = nil) ⇒ Account

Returns a new instance of Account.



17
18
19
20
21
# File 'lib/zimbra/account.rb', line 17

def initialize(id, name, zimbra_attrs = {}, node = nil)
  super
  self.cos_id = zimbra_attrs['zimbraCOSId']
  self.delegated_admin = zimbra_attrs['zimbraIsDelegatedAdminAccount']
end

Instance Attribute Details

#cos_idObject

Returns the value of attribute cos_id.



15
16
17
# File 'lib/zimbra/account.rb', line 15

def cos_id
  @cos_id
end

Class Method Details

.acl_nameObject



9
10
11
# File 'lib/zimbra/account.rb', line 9

def acl_name
  'usr'
end

.create(name, password, attributes = {}) ⇒ Object



5
6
7
# File 'lib/zimbra/account.rb', line 5

def create(name, password, attributes = {})
  AccountService.create(name, password, attributes)
end

Instance Method Details

#add_alias(alias_name) ⇒ Object



39
40
41
# File 'lib/zimbra/account.rb', line 39

def add_alias(alias_name)
  AccountService.add_alias(self, alias_name)
end

#delegated_admin=(val) ⇒ Object



23
24
25
# File 'lib/zimbra/account.rb', line 23

def delegated_admin=(val)
  @delegated_admin = Zimbra::Boolean.read(val)
end

#delegated_admin?Boolean

Returns:



27
28
29
# File 'lib/zimbra/account.rb', line 27

def delegated_admin?
  @delegated_admin
end

#saveObject



31
32
33
# File 'lib/zimbra/account.rb', line 31

def save
  AccountService.modify(self)
end

#set_password(new_password) ⇒ Object



35
36
37
# File 'lib/zimbra/account.rb', line 35

def set_password(new_password)
  AccountService.set_password(id, new_password)
end