From fbac33e308d383fc55474bcaaf90342d94168277 Mon Sep 17 00:00:00 2001 From: C Robert Date: Thu, 10 Sep 2009 20:01:24 +0000 Subject: [PATCH] Mantis 128: permission priority in calendar sharing Monotone-Parent: 6918a1019209b61ce28a95f69b6866052f2da402 Monotone-Revision: c3073560ecefd7e654284be77264558f35df1171 Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-09-10T20:01:24 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 2 ++ SoObjects/SOGo/SOGoGCSFolder.m | 13 +++++++++++-- UI/WebServerResources/UIxContactsUserFolders.js | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8a92d3ef..074ca3d74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -58,6 +58,8 @@ parent method to remove the calendar for the user's settings. * SoObjects/Appointments/SOGoWebAppointmentFolder.m: Added some error management, for when the url is invalid / not ical / etc. + * SoObjects/SOGo/SOGoGCSFolder.m (_fetchAclsForUser: forObjectAtPath:): + Ignore group acls if we found acls for the user. 2009-09-10 Wolfgang Sourdeau diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index b89ded31d..ea276d269 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -1192,6 +1192,7 @@ static NSArray *childRecordFields = nil; NSArray *records; NSMutableArray *acls; NSString *qs; + BOOL foundUserAcls; // We look for the exact uid or any uid that begins with "@" (corresponding to groups) qs = [NSString stringWithFormat: @"(c_object = '/%@') AND (c_uid = '%@' OR c_uid LIKE '@%%')", @@ -1207,13 +1208,21 @@ static NSArray *childRecordFields = nil; SOGoGroup *group; SOGoUser *user; + foundUserAcls = NO; + for (i = 0; i < [records count]; i ++) { record = [records objectAtIndex: i]; currentUid = [record valueForKey: @"c_uid"]; if ([currentUid isEqualToString: uid]) - [acls addObject: [record valueForKey: @"c_role"]]; - else + { + [acls addObject: [record valueForKey: @"c_role"]]; + foundUserAcls = YES; + } + } + if (!foundUserAcls) + { + for (i = 0; i < [records count]; i ++) { group = [SOGoGroup groupWithIdentifier: currentUid]; if (group) diff --git a/UI/WebServerResources/UIxContactsUserFolders.js b/UI/WebServerResources/UIxContactsUserFolders.js index 5cae2c47c..4f3dd8972 100644 --- a/UI/WebServerResources/UIxContactsUserFolders.js +++ b/UI/WebServerResources/UIxContactsUserFolders.js @@ -11,7 +11,7 @@ function onSearchFormSubmit() { } else { var url = (UserFolderURL - + "usersSearch?search=" + encodedValue); + + "usersSearch?search=" + encodedValue + "&excludeGroups=1"); if (document.userFoldersRequest) { document.userFoldersRequest.aborted = true; document.userFoldersRequest.abort();