Module: Zimbra::DirectoryService::Builder
- Defined in:
- lib/zimbra/directory.rb
Class Method Summary collapse
- .add_grant(message, id, type, acl) ⇒ Object
- .get_grants(message, id, type) ⇒ Object
- .revoke_grant(message, id, type, acl) ⇒ Object
- .search_directory(message, query, type, domain, options) ⇒ Object
Class Method Details
.add_grant(message, id, type, acl) ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/zimbra/directory.rb', line 103 def add_grant(, id, type, acl) .add 'target', id do |c| c.set_attr 'by', 'id' c.set_attr 'type', type end .add 'grantee', acl.grantee_name do |grantee| grantee.set_attr 'by', 'name' grantee.set_attr 'type', acl.grantee_class.acl_name end .add 'right', acl.name end |
.get_grants(message, id, type) ⇒ Object
96 97 98 99 100 101 |
# File 'lib/zimbra/directory.rb', line 96 def get_grants(, id, type) .add 'target', id do |c| c.set_attr 'by', 'id' c.set_attr 'type', type end end |
.revoke_grant(message, id, type, acl) ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/zimbra/directory.rb', line 115 def revoke_grant(, id, type, acl) .add 'target', id do |c| c.set_attr 'by', 'id' c.set_attr 'type', type end .add 'grantee', acl.grantee_name do |grantee| grantee.set_attr 'by', 'name' grantee.set_attr 'type', acl.grantee_class.acl_name end .add 'right', acl.name end |
.search_directory(message, query, type, domain, options) ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'lib/zimbra/directory.rb', line 86 def search_directory(, query, type, domain, ) .set_attr 'types', ZIMBRA_TYPES_HASH[type][:zimbra_type] .set_attr 'query', query .set_attr('domain', domain) if domain .set_attr('limit', [:limit]) if [:limit] .set_attr('offset', [:offset]) if [:offset] .set_attr('sort_by', [:sort_by]) if [:sort_by] .set_attr('sort_ascending', [:sort_ascending]) if [:sort_ascending] end |