diff --git a/ChangeLog b/ChangeLog index a3b465231..ea05b9b29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-07-04 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoCalendarComponent.m + ([SOGoCalendarComponent -contentAsString]): we return the content + based on the permissions returned by the security manager instead + of by looking at the user roles. + * SoObjects/Appointments/SOGoAppointmentFolder.m ([SOGoAppointmentFolder -calendarFolders]): read the calendar folders of the user to whom this folder belongs instead of the diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 5f707b181..5f987aa5b 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -111,23 +111,38 @@ static BOOL sendEMailNotifications = NO; - (NSString *) contentAsString { - NSString *uid; iCalCalendar *tmpCalendar; iCalRepeatableEntityObject *tmpComponent; - NSArray *roles; +// NSArray *roles; +// NSString *uid; + SoSecurityManager *sm; if (!calContent) { - uid = [[context activeUser] login]; - roles = [self aclsForUser: uid]; - if ([roles containsObject: SOGoCalendarRole_Organizer] - || [roles containsObject: SOGoCalendarRole_Participant] - || [roles containsObject: SOGoCalendarRole_ComponentViewer]) - { - calContent = content; - [calContent retain]; - } - else if ([roles containsObject: SOGoCalendarRole_ComponentDAndTViewer]) +// uid = [[context activeUser] login]; +// roles = [self aclsForUser: uid]; +// if ([roles containsObject: SOGoCalendarRole_Organizer] +// || [roles containsObject: SOGoCalendarRole_Participant] +// || [roles containsObject: SOGoCalendarRole_ComponentViewer]) +// calContent = content; +// else if ([roles containsObject: SOGoCalendarRole_ComponentDAndTViewer]) +// { +// tmpCalendar = [[self calendar: NO] copy]; +// tmpComponent = (iCalRepeatableEntityObject *) +// [tmpCalendar firstChildWithTag: [self componentTag]]; +// [self _filterComponent: tmpComponent]; +// calContent = [tmpCalendar versitString]; +// [tmpCalendar release]; +// } +// else +// calContent = nil; + + sm = [SoSecurityManager sharedSecurityManager]; + if (![sm validatePermission: SOGoCalendarPerm_ViewAllComponent + onObject: self inContext: context]) + calContent = content; + else if (![sm validatePermission: SOGoCalendarPerm_ViewDAndT + onObject: self inContext: context]) { tmpCalendar = [[self calendar: NO] copy]; tmpComponent = (iCalRepeatableEntityObject *) @@ -606,7 +621,6 @@ static BOOL sendEMailNotifications = NO; else if ([roles containsObject: SOGoRole_ObjectCreator]) [roles addObject: SOGoCalendarRole_Organizer]; } -// } return roles; }