summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-08-13 09:37:31 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-08-13 09:39:41 +0200
commita45ca0dac73ff8c26a62134fd7887d58d7f5202d (patch)
tree33ddab0b92d9a533e4df5e9e721acd37a09df583
parent8264aef9f68b93cc8c92279c1e7be83db8b9b3dc (diff)
downloadpykolab-a45ca0dac73ff8c26a62134fd7887d58d7f5202d.tar.gz
Increase compatibility with UCS-formed ACL entries for folders (#4990)
-rw-r--r--pykolab/auth/ldap/__init__.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 62acf27..01fd41c 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -1325,7 +1325,11 @@ class LDAP(pykolab.base.Base):
for acl_entry in entry[folderacl_entry_attribute]:
acl_access = acl_entry.split()[-1]
- aci_subject = ', '.join(acl_entry.split(', ')[:-1])
+
+ if len(acl_entry.split(', ')) > 0:
+ aci_subject = ', '.join(acl_entry.split(', ')[:-1])
+ else:
+ aci_subject = acl_entry.split()[0]
log.debug(_("Found a subject %r with access %r") % (aci_subject, acl_access), level=8)
@@ -1715,7 +1719,11 @@ class LDAP(pykolab.base.Base):
for acl_entry in entry[folderacl_entry_attribute]:
acl_access = acl_entry.split()[-1]
- aci_subject = ', '.join(acl_entry.split(', ')[:-1])
+
+ if len(acl_entry.split(', ')) > 0:
+ aci_subject = ', '.join(acl_entry.split(', ')[:-1])
+ else:
+ aci_subject = acl_entry.split()[0]
log.debug(_("Found a subject %r with access %r") % (aci_subject, acl_access), level=8)