summaryrefslogtreecommitdiffstats
path: root/pykolab/auth/ldap/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'pykolab/auth/ldap/__init__.py')
-rw-r--r--pykolab/auth/ldap/__init__.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 615a3b4..dd477ef 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -429,6 +429,25 @@ class LDAP(pykolab.base.Base):
return recipient_addresses
+ def list_delegators(self, entry_id):
+ """
+ Get a list of user records the given user is set to be a delegatee
+ """
+ delegators = []
+
+ mailbox_attribute = conf.get('cyrus-sasl', 'result_attribute')
+ if mailbox_attribute == None:
+ mailbox_attribute = 'mail'
+
+ for __delegator in self.search_entry_by_attribute('kolabDelegate', entry_id):
+ (_dn, _delegator) = __delegator
+ _delegator['dn'] = _dn;
+ _delegator['_mailbox_basename'] = _delegator[mailbox_attribute] if _delegator.has_key(mailbox_attribute) else None
+ if isinstance(_delegator['_mailbox_basename'], list):
+ _delegator['_mailbox_basename'] = _delegator['_mailbox_basename'][0]
+ delegators.append(_delegator)
+
+ return delegators
def find_recipient(self, address="*", exclude_entry_id=None):
"""