Page MenuHomePhorge

D2653.1775263305.diff
No OneTemporary

Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None

D2653.1775263305.diff

diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -408,7 +408,7 @@
current_acls = self.imap.lam(self.folder_utf7(folder))
for current_acl in current_acls.keys():
- if current_acl == identifier:
+ if current_acl == identifier.lower():
_acl = current_acls[current_acl]
break
@@ -418,12 +418,17 @@
acl = ''.join(list(set(_acl)))
try:
- self.imap.sam(self.folder_utf7(folder), identifier, acl)
+ _folder = self.folder_utf7(folder)
+ log.debug(
+ _("IMAP SAM command with calculated ACL rights %s for %s on folder %s") % \
+ (acl, identifier, _folder), level=8
+ )
+ self.imap.sam(_folder, identifier, acl)
except Exception as errmsg:
log.error(
_("Could not set ACL for %s on folder %s: %r") % (
identifier,
- folder,
+ _folder,
errmsg
)
)
@@ -892,9 +897,11 @@
if update is True and isinstance(acls, list) and len(acls) == 0:
acls = self.list_acls(folder)
for subject in acls:
+ subject = subject.lower()
log.debug(
- _("Removing ACL rights %s for subject %s on folder " + \
- "%s") % (acls[subject], subject, folder), level=8)
+ _("Special case: Update with ACLs %s " + \
+ "for subject %s on folder %s") % \
+ (acls[subject], subject, folder), level=6)
self.set_acl(folder, subject, '')
return
@@ -906,7 +913,7 @@
for acl in acls:
exec("acl = %s" % (acl))
- subject = acl[0]
+ subject = acl[0].lower()
rights = acl[1]
if len(acl) == 3:
epoch = acl[2]
@@ -917,8 +924,9 @@
if update is True:
if old_acls is None:
old_acls = self.list_acls(folder)
- for old_subject in old_acls:
- old_acls[old_subject] = old_acls[old_subject]
+ # Removing, does not make sense
+ # for old_subject in old_acls:
+ # old_acls[old_subject] = old_acls[old_subject]
if subject in old_acls:
old_acls[subject] = None
@@ -926,7 +934,7 @@
if epoch > (int)(time.time()):
log.debug(
_("Setting ACL rights %s for subject %s on folder " + \
- "%s") % (rights, subject, folder), level=8)
+ "%s") % (rights, subject, folder), level=6)
self.set_acl(
folder,
@@ -936,8 +944,8 @@
else:
log.debug(
- _("Removing ACL rights %s for subject %s on folder " + \
- "%s") % (rights, subject, folder), level=8)
+ _("Removing %s ACL rights for subject %s on folder " + \
+ "%s") % (rights, subject, folder), level=6)
self.set_acl(
folder,
@@ -950,8 +958,8 @@
for subject in old_acls:
if old_acls[subject] is not None:
log.debug(
- _("Removing ACL rights %s for subject %s on folder " + \
- "%s") % (old_acls[subject], subject, folder), level=8)
+ _("Update mode: Unset %s ACLs for subject %s on folder " + \
+ "%s") % (old_acls[subject], subject, folder), level=6)
self.set_acl(folder, subject, '')
pass

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 4, 12:41 AM (22 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18826868
Default Alt Text
D2653.1775263305.diff (3 KB)

Event Timeline