From 0fe7a9df572e3291735d70c52ccf53013a685ba2 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 30 Dec 2008 22:25:30 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: f68bc0f7c4af372fd5c49f8961ad1605dd875d1f Monotone-Revision: 08c3123324ab89795cc2faa5f26bd5427cd30786 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2008-12-30T22:25:30 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 9 +++++++++ SoObjects/SOGo/SOGoGCSFolder.m | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8626d7f85..0b846458b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,15 @@ UI/WebServerResources/SchedulerUI.js Fixed the escaping of characters and associated search methods. + * SoObjects/SOGo/SOGoGCSFolder.m + ([SOGoGCSFolder aclsForUser:forObjectAtPath:]): + Added two new defaults to control the default + ACLs when none are specified: + SOGoCalendarDefaultRoles and SOGoContactsDefaultRoles + They are both arrays in which we set strings, + for example : + SOGoCalendarDefaultRoles = ("ObjectCreator", "PublicViewer"); + SOGoContactsDefaultRoles = ("ObjectEditor"); 2008-12-30 Francis Lachapelle diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 21d0176d7..fc25a53fa 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -819,6 +819,17 @@ static NSArray *childRecordFields = nil; acls = [self aclsForUser: defaultUserID forObjectAtPath: objectPathArray]; + // If we still don't have ACLs defined for this particular resource, + // let's go get the system-wide defaults, if any. + if (![acls count]) + { + if ([[container nameInContainer] isEqualToString: @"Calendar"] || + [[container nameInContainer] isEqualToString: @"Contacts"]) + acls = [[NSUserDefaults standardUserDefaults] + objectForKey: [NSString stringWithFormat: @"SOGo%@DefaultRoles", + [container nameInContainer]]]; + } + return acls; }