diff --git a/ChangeLog b/ChangeLog index 51f5bc233..288c513a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-11-21 Francis Lachapelle + + * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor + -calendarList]): also returns the calendar of the current + event. This is required so the proper calender is selected when + you view an event to which you don't have write access. + + * UI/Common/UIxAclEditor.m ([UIxAclEditor -currentUserIsOwner]): + also returns true for super users. + 2007-11-21 Wolfgang Sourdeau * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject diff --git a/UI/Common/UIxAclEditor.m b/UI/Common/UIxAclEditor.m index 123bd4961..a3226e517 100644 --- a/UI/Common/UIxAclEditor.m +++ b/UI/Common/UIxAclEditor.m @@ -30,6 +30,7 @@ #import #import #import +#import #import "UIxAclEditor.h" @@ -149,17 +150,6 @@ return [self _displayNameForUID: currentUser]; } -- (NSString *) toolbar -{ - NSString *currentLogin, *ownerLogin; - - currentLogin = [[context activeUser] login]; - ownerLogin = [[self clientObject] ownerInContext: context]; - - return (([ownerLogin isEqualToString: currentLogin]) - ? @"SOGoAclOwner.toolbar" : @"SOGoAclAssistant.toolbar"); -} - - (void) setUserUIDS: (NSString *) retainedUsers { if ([retainedUsers length] > 0) @@ -199,13 +189,17 @@ - (BOOL) currentUserIsOwner { SOGoObject *clientObject; + SOGoUser *currentUser; NSString *currentUserLogin, *ownerLogin; clientObject = [self clientObject]; ownerLogin = [clientObject ownerInContext: context]; - currentUserLogin = [[context activeUser] login]; - - return [ownerLogin isEqualToString: currentUserLogin]; + currentUser = [context activeUser]; + currentUserLogin = [currentUser login]; + + return ([ownerLogin isEqualToString: currentUserLogin] + || ([currentUser respondsToSelector: @selector (isSuperUser)] + && [currentUser isSuperUser])); } // - (id ) addUserInAcls diff --git a/UI/Scheduler/UIxComponentEditor.h b/UI/Scheduler/UIxComponentEditor.h index 12ff2c7b7..34b2688da 100644 --- a/UI/Scheduler/UIxComponentEditor.h +++ b/UI/Scheduler/UIxComponentEditor.h @@ -74,6 +74,8 @@ - (void) setItem: (id) _item; - (id) item; +- (SOGoAppointmentFolder *) componentCalendar; + - (NSArray *) categoryList; - (void) setCategories: (NSArray *) _categories; - (NSArray *) categories; diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 49083d4ea..9e5f812f8 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -453,7 +453,7 @@ - (NSArray *) calendarList { - SOGoAppointmentFolder *currentCalendar; + SOGoAppointmentFolder *calendar, *currentCalendar; SOGoAppointmentFolders *calendarParent; NSEnumerator *allCalendars; SoSecurityManager *sm; @@ -467,9 +467,11 @@ calendarParent = [[context activeUser] calendarsFolderInContext: context]; sm = [SoSecurityManager sharedSecurityManager]; + calendar = [self componentCalendar]; allCalendars = [[calendarParent subFolders] objectEnumerator]; while ((currentCalendar = [allCalendars nextObject])) - if (![sm validatePermission: perm + if ([calendar isEqual: currentCalendar] || + ![sm validatePermission: perm onObject: currentCalendar inContext: context]) [calendarList addObject: currentCalendar]; diff --git a/UI/Templates/SchedulerUI/UIxComponentEditor.wox b/UI/Templates/SchedulerUI/UIxComponentEditor.wox index 2c01d63ec..84b1d0324 100644 --- a/UI/Templates/SchedulerUI/UIxComponentEditor.wox +++ b/UI/Templates/SchedulerUI/UIxComponentEditor.wox @@ -48,7 +48,7 @@