summaryrefslogtreecommitdiffstats
path: root/wallace/module_resources.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-19 11:57:34 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-19 11:57:34 -0400
commit36ef0b35a936cc49e490d132d88922968c1eb471 (patch)
tree15da0348f3d8581ea463b2f0c3ca9f35e9a5f3c9 /wallace/module_resources.py
parentc8560954615b94e21b7605a1e095481c6a022721 (diff)
downloadpykolab-36ef0b35a936cc49e490d132d88922968c1eb471.tar.gz
Set read ACLs for admin user before accessing resource calendars (#3428)
Diffstat (limited to 'wallace/module_resources.py')
-rw-r--r--wallace/module_resources.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index c41413a..aa3c473 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -533,6 +533,9 @@ def read_resource_calendar(resource_rec, itip_events):
level=9
)
+ # set read ACLs for admin user
+ imap.set_acl(mailbox, conf.get(conf.get('kolab', 'imap_backend'), 'admin_login'), "lrs")
+
# might raise an exception, let that bubble
imap.imap.m.select(imap.folder_quote(mailbox))
typ, data = imap.imap.m.search(None, 'ALL')
@@ -686,7 +689,7 @@ def save_resource_event(itip_event, resource, replace=False):
if replace:
delete_resource_event(itip_event['uid'], resource)
else:
- imap.imap.m.setacl(targetfolder, conf.get(conf.get('kolab', 'imap_backend'), 'admin_login'), "lrswipkxtecda")
+ imap.set_acl(targetfolder, conf.get(conf.get('kolab', 'imap_backend'), 'admin_login'), "lrswipkxtecda")
result = imap.imap.m.append(
targetfolder,
@@ -709,7 +712,7 @@ def delete_resource_event(uid, resource):
Removes the IMAP object with the given UID from a resource's calendar folder
"""
targetfolder = imap.folder_quote(resource['kolabtargetfolder'])
- imap.imap.m.setacl(targetfolder, conf.get(conf.get('kolab', 'imap_backend'), 'admin_login'), "lrswipkxtecda")
+ imap.set_acl(targetfolder, conf.get(conf.get('kolab', 'imap_backend'), 'admin_login'), "lrswipkxtecda")
imap.imap.m.select(targetfolder)
typ, data = imap.imap.m.search(None, '(HEADER SUBJECT "%s")' % uid)