Module: Zimbra::Directory

Defined in:
lib/zimbra/directory.rb

Constant Summary collapse

TARGET_TYPES_MAPPING =
{
  Zimbra::Account => 'account',
  Zimbra::DistributionList => 'dl',
  Zimbra::Domain => 'domain'
}

Class Method Summary collapse

Class Method Details

.add_grant(target, acl) ⇒ Object



24
25
26
# File 'lib/zimbra/directory.rb', line 24

def add_grant(target, acl)
  DirectoryService.add_grant(target.id, target.zimbra_type, acl)
end

.get_grants(target) ⇒ Object



28
29
30
# File 'lib/zimbra/directory.rb', line 28

def get_grants(target)
  DirectoryService.get_grants(target.id, target.zimbra_type)
end

.revoke_grant(target, acl) ⇒ Object



32
33
34
# File 'lib/zimbra/directory.rb', line 32

def revoke_grant(target, acl)
  DirectoryService.revoke_grant(target.id, target.zimbra_type, acl)
end

.search(query = '', type: 'account', domain: nil, **options) ⇒ Object

Run a search over the Ldap server of Zimbra query: is a valid LDAP search query types: a comma separated string of types of objects to look for domain: the email domain you want to limit the search to options: max results of the search options options options: 1=true , 0=false



19
20
21
22
# File 'lib/zimbra/directory.rb', line 19

def search(query = '', type: 'account', domain: nil, **options)
  options[:limit] ||= 25
  DirectoryService.search(query, type.to_sym, domain, options)
end