]> err.no Git - scalable-opengroupware.org/blobdiff - SOGo/UI/Scheduler/UIxAppointmentEditor.m
Fixed 'only organizer can edit appointments' once and for all, moved some functionality
[scalable-opengroupware.org] / SOGo / UI / Scheduler / UIxAppointmentEditor.m
index 945711d7236fbf37737b2d34a05cf07b64abacdc..e971ea0c4c2ed173eb4c54deb857d3809d81bfe6 100644 (file)
   [_appointment setAccessClass:[self accessClass]];
   [_appointment setTransparency:[self transparency]];
 
+#if 0
+  /* bad, bad, bad!
+   * Organizer is no form value, thus we MUST NOT change it
+   */
   [_appointment setOrganizer:self->organizer];
+#endif
   attendees  = [self participants];
   lResources = [self resources];
   if ([lResources count] > 0) {
 /* access */
 
 - (BOOL)isMyApt {
+  if (!self->organizer) return YES; // assume this is safe to do, right?
   return [[self->organizer rfc822Email] isEqualToString:[self emailForUser]];
 }
 
   [self setContentString:ical];
   [self loadValuesFromContentString:ical];
   
+  if (![self canEditApt]) {
+    /* TODO: we need proper ACLs */
+    return [self redirectToLocation:[self _completeURIForMethod:@"../view"]];
+  }
   return self;
 }