From 5ad9041187f535b5eae98564f0a60420b5b71bc9 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 Jan 2008 21:54:59 +0000 Subject: [PATCH] Monotone-Parent: 3ed608f2d193596ff9ea26138010a888e87b0929 Monotone-Revision: c00890a3638719c75d4c3a2a1be8103137ce8223 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-01-22T21:54:59 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 11 +++++++++++ SoObjects/Appointments/SOGoAppointmentFolder.m | 11 ++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 413fc320f..2ca4d37de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-01-22 Wolfgang Sourdeau + + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([SOGoAppointmentFolder + -fetchFields:_fieldsfromFolder:_folderfrom:_startDateto:_endDatetitle:titlecomponent:_component]): + change the algorithm a little bit to compare the roles of the + current users to see if he is an "owner" instead of solely + checking its login name. This enables the users listed as + "SuperUsers" to be considered as owners and see everything as + expected. + 2008-01-18 Wolfgang Sourdeau * SoObjects/Contacts/SOGoFolder+CardDAV.m ([SOGoFolder diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index da40ac840..190982a9d 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -752,21 +752,22 @@ static NSNumber *sharedYes = nil; - (NSString *) _privacySqlString { - NSString *privacySqlString, *login, *email; + NSString *privacySqlString, *email, *login; SOGoUser *activeUser; activeUser = [context activeUser]; - login = [activeUser login]; - if ([login isEqualToString: owner]) + if ([[activeUser rolesForObject: self inContext: context] + containsObject: SoRole_Owner]) privacySqlString = @""; - else if ([login isEqualToString: @"freebusy"]) + else if ([[activeUser login] isEqualToString: @"freebusy"]) privacySqlString = @"and (c_isopaque = 1)"; else { #warning we do not manage all the possible user emails email = [[activeUser primaryIdentity] objectForKey: @"email"]; - + login = [activeUser login]; + privacySqlString = [NSString stringWithFormat: @"(%@(c_orgmail = '%@')"