summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-04 19:39:35 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-04 19:46:28 (GMT)
commita15fe609702bffb00e6fb47e5129acce2798a07b (patch)
tree1c930c88c6ce00356ebafcb7110fd8fc1da87771
parent542ec1d797130b674ed46a9d7a7e94c056f34266 (diff)
downloadpykolab-a15fe609702bffb00e6fb47e5129acce2798a07b.tar.gz
Be compatible with what the Kolab Web Administration Panel is writing out
-rw-r--r--pykolab/auth/ldap/__init__.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 752b4fc..f15d2c8 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -1816,9 +1816,26 @@ class LDAP(pykolab.base.Base):
if entry.has_key('kolabfolderaclentry') and \
not entry['kolabfolderaclentry'] == None:
+ if isinstance(entry['kolabfolderaclentry'], basestring):
+ entry['kolabfolderaclentry'] = [ entry['kolabfolderaclentry'] ]
+
+ import copy
+ _acls = copy.deepcopy(entry['kolabfolderaclentry'])
+ entry['kolabfolderaclentry'] = []
+
+ for _entry in _acls:
+ if _entry[0] == "(":
+ entry['kolabfolderaclentry'].append(_entry)
+ continue
+
+ s,r = [x.strip() for x in _entry.split(',')]
+
+ entry['kolabfolderaclentry'].append("('%s', '%s', '%s')" % (folder_path, s, r))
+
self.imap._set_kolab_mailfolder_acls(
entry['kolabfolderaclentry']
)
+
elif entry['kolabfolderaclentry'] in [None,[]]:
for ace in self.imap.list_acls(folder_path):
aci_subject = ace.split()[0]