See ChangeLoG

Monotone-Parent: 4f0bf8feeb9303c272c290edf3a27a53d5f0e7f6
Monotone-Revision: 362796632635e06d244977f425250ed41b4cd5c2

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-10-23T15:04:28
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2009-10-23 15:04:28 +00:00
parent e3702243df
commit c8e3e69ae2
2 changed files with 31 additions and 31 deletions
+6
View File
@@ -1,3 +1,9 @@
2009-10-23 Francis Lachapelle <flachapelle@inverse.ca>
* UI/Scheduler/UIxComponentEditor.m (-calendarList): added proper
verification of deletion rights on the current calendar and
creation rights on other calendars.
2009-10-22 Ludovic Marcotte <lmarcotte@inverse.ca>
* SoObjects/SOGo/SOGoUserManager.m
+25 -31
View File
@@ -997,25 +997,6 @@ iRANGE(2);
return [NSNumber numberWithInt: participationStatus];
}
- (NSString *) _permissionForEditing
{
NSString *perm;
if ([[self clientObject] isNew])
perm = SoPerm_AddDocumentsImagesAndFiles;
else
{
if ([privacy isEqualToString: @"PRIVATE"])
perm = SOGoCalendarPerm_ModifyPrivateRecords;
else if ([privacy isEqualToString: @"CONFIDENTIAL"])
perm = SOGoCalendarPerm_ModifyConfidentialRecords;
else
perm = SOGoCalendarPerm_ModifyPublicRecords;
}
return perm;
}
- (NSArray *) calendarList
{
SOGoAppointmentFolder *calendar, *currentCalendar;
@@ -1027,19 +1008,32 @@ iRANGE(2);
if (!calendarList)
{
calendarList = [NSMutableArray new];
perm = [self _permissionForEditing];
calendarParent
= [[context activeUser] calendarsFolderInContext: context];
sm = [SoSecurityManager sharedSecurityManager];
calendar = [self componentCalendar];
allCalendars = [[calendarParent subFolders] objectEnumerator];
while ((currentCalendar = [allCalendars nextObject]))
if ([calendar isEqual: currentCalendar] ||
![sm validatePermission: perm
onObject: currentCalendar
inContext: context])
[calendarList addObject: currentCalendar];
sm = [SoSecurityManager sharedSecurityManager];
perm = SoPerm_DeleteObjects;
if ([sm validatePermission: perm
onObject: calendar
inContext: context])
{
// User can't delete components from this calendar;
// don't add any calendar other than the current one
[calendarList addObject: calendar];
}
else
{
// Find which calendars user has creation rights
perm = SoPerm_AddDocumentsImagesAndFiles;
calendarParent
= [[context activeUser] calendarsFolderInContext: context];
allCalendars = [[calendarParent subFolders] objectEnumerator];
while ((currentCalendar = [allCalendars nextObject]))
if ([calendar isEqual: currentCalendar] ||
![sm validatePermission: perm
onObject: currentCalendar
inContext: context])
[calendarList addObject: currentCalendar];
}
}
return calendarList;