Monotone-Parent: 4f816dc3f00ef57497bb9cff9370cf0b8a272fc6

Monotone-Revision: 90a65543c12f64be022dceaada5327dafced8237

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-11-09T19:45:18
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2007-11-09 19:45:18 +00:00
parent 1e1c641f60
commit 1392e103a2
+17 -1
View File
@@ -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];
}