From 1392e103a2e31577f3252507ab405b12ff9a659b Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 9 Nov 2007 19:45:18 +0000 Subject: [PATCH] Monotone-Parent: 4f816dc3f00ef57497bb9cff9370cf0b8a272fc6 Monotone-Revision: 90a65543c12f64be022dceaada5327dafced8237 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2007-11-09T19:45:18 Monotone-Branch: ca.inverse.sogo --- UI/Scheduler/UIxComponentEditor.m | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 045f9bdd8..0c07730d8 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -335,9 +335,23 @@ SOGoAppointmentFolder *calendar, *currentCalendar; SOGoAppointmentFolders *calendarParent; NSEnumerator *allCalendars; + SoSecurityManager *sm; + NSString *perm, *privacy; if (!calendarList) { + sm = [SoSecurityManager sharedSecurityManager]; + if ([[self clientObject] isNew]) + perm = SoPerm_AddDocumentsImagesAndFiles; + else { + privacy = [component accessClass]; + if ([privacy isEqualToString: @"PRIVATE"]) + perm = SOGoCalendarPerm_ModifyPrivateRecords; + else if ([privacy isEqualToString: @"CONFIDENTIAL"]) + perm = SOGoCalendarPerm_ModifyConfidentialRecords; + else + perm = SOGoCalendarPerm_ModifyPublicRecords; + } calendarList = [NSMutableArray new]; calendar = [[self clientObject] container]; calendarParent = [calendar container]; @@ -345,7 +359,9 @@ currentCalendar = [allCalendars nextObject]; while (currentCalendar) { - if ([currentCalendar isActive]) + if (![sm validatePermission: perm + onObject: currentCalendar + inContext: context]) [calendarList addObject: currentCalendar]; currentCalendar = [allCalendars nextObject]; }