Class: Zimbra::AccountService::Builder
- Inherits:
-
Object
- Object
- Zimbra::AccountService::Builder
- Defined in:
- lib/zimbra/account.rb
Class Method Summary collapse
- .create(message, account) ⇒ Object
- .delete(message, id) ⇒ Object
- .get_by_id(message, id) ⇒ Object
- .get_by_name(message, name) ⇒ Object
- .modify(message, account) ⇒ Object
- .modify_attributes(message, account) ⇒ Object
Class Method Details
.create(message, account) ⇒ Object
97 98 99 100 101 |
# File 'lib/zimbra/account.rb', line 97 def create(, account) .add 'name', account.name .add 'password', account.password A.inject(, 'zimbraCOSId', account.cos_id) end |
.delete(message, id) ⇒ Object
131 132 133 |
# File 'lib/zimbra/account.rb', line 131 def delete(, id) .add 'id', id end |
.get_by_id(message, id) ⇒ Object
103 104 105 106 107 |
# File 'lib/zimbra/account.rb', line 103 def get_by_id(, id) .add 'account', id do |c| c.set_attr 'by', 'id' end end |
.get_by_name(message, name) ⇒ Object
109 110 111 112 113 |
# File 'lib/zimbra/account.rb', line 109 def get_by_name(, name) .add 'account', name do |c| c.set_attr 'by', 'name' end end |
.modify(message, account) ⇒ Object
115 116 117 118 |
# File 'lib/zimbra/account.rb', line 115 def modify(, account) .add 'id', account.id modify_attributes(, distribution_list) end |
.modify_attributes(message, account) ⇒ Object
119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/zimbra/account.rb', line 119 def modify_attributes(, account) if account.acls.empty? ACL.delete_all() else account.acls.each do |acl| acl.apply() end end Zimbra::A.inject(node, 'zimbraCOSId', account.cos_id) Zimbra::A.inject(node, 'zimbraIsDelegatedAdminAccount', (delegated_admin ? 'TRUE' : 'FALSE')) end |