mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 11:25:24 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user