Class: Zimbra::DirectoryService

Inherits:
HandsoapService show all
Defined in:
lib/zimbra/directory.rb

Defined Under Namespace

Modules: Builder, Parser

Constant Summary collapse

ZIMBRA_TYPES_HASH =

This are the type off types (objects) that Zimbra has “distributionlists,aliases,accounts,dynamicgroups,resources,domains”

{
  distribution_list: { zimbra_type: 'distributionlists', node_name: 'dl', class: Zimbra::DistributionList },
  distributionlist: { zimbra_type: 'distributionlists', node_name: 'dl', class: Zimbra::DistributionList },
  #alias: { zimbra_type: 'aliases', node_name: 'alias', class: Zimbra::Alias },
  account: { zimbra_type: 'accounts', node_name: 'account', class: Zimbra::Account },
  domain: { zimbra_type: 'domains', node_name: 'domain', class: Zimbra::Domain }
}

Instance Method Summary collapse

Methods inherited from HandsoapService

#on_create_document, #on_response_document

Methods included from HandsoapUriOverrides

#envelope_namespace, #request_content_type, #uri

Methods included from HandsoapNamespaces

#request_namespaces, #response_namespaces

Methods included from HandsoapErrors

#http_error?, #http_not_found?, #on_after_create_http_request, #on_http_error, #report_error, #soap_fault_not_found?

Instance Method Details

#add_grant(id, type, acl) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/zimbra/directory.rb', line 50

def add_grant(id, type, acl)
  xml = invoke("n2:GrantRightRequest") do |message|
    Builder.add_grant(message, id, type, acl)
  end
  return nil if soap_fault_not_found?
  true
end

#get_grants(id, type) ⇒ Object



68
69
70
71
72
73
74
# File 'lib/zimbra/directory.rb', line 68

def get_grants(id, type)
  xml = invoke('n2:GetGrantsRequest') do |message|
    Builder.get_grants(message, id, type)
  end
  return nil if soap_fault_not_found?
  Parser.get_grants_response(xml, type)
end

#revoke_grant(id, type, acl) ⇒ Object



76
77
78
79
80
81
82
# File 'lib/zimbra/directory.rb', line 76

def revoke_grant(id, type, acl)
  xml = invoke("n2:RevokeRightRequest") do |message|
    Builder.revoke_grant(message, id, type, acl)
  end
  return nil if soap_fault_not_found?
  true
end

#search(query, type, domain, options = {}) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/zimbra/directory.rb', line 58

def search(query, type, domain, options = {})
  xml = invoke("n2:SearchDirectoryRequest") do |message|
    Builder.search_directory(message, query, type, domain, options)
  end
  return nil if soap_fault_not_found?
  Parser.search_directory_response(xml, type)
end