[CalendarServer-changes] [12834] CalendarServer/trunk/txdav/caldav/datastore/scheduling/implicit.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Mar 6 15:06:36 PST 2014


Revision: 12834
          http://trac.calendarserver.org//changeset/12834
Author:   cdaboo at apple.com
Date:     2014-03-06 15:06:36 -0800 (Thu, 06 Mar 2014)
Log Message:
-----------
Allow storing an event without a matching attendee.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/caldav/datastore/scheduling/implicit.py

Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/implicit.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/implicit.py	2014-03-06 23:05:51 UTC (rev 12833)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/implicit.py	2014-03-06 23:06:36 UTC (rev 12834)
@@ -1471,15 +1471,26 @@
                         "Cannot change organizer",
                     ))
 
-            # Never allow a missing attendee with a locally hosted organizer
+            # Never allow an attendee with a locally hosted organizer to remove their attendee property
             if isinstance(self.organizerAddress, LocalCalendarUser):
-                log.error("Cannot remove ATTENDEE: UID:{uid}", uid=self.uid)
-                raise HTTPError(ErrorResponse(
-                    responsecode.FORBIDDEN,
-                    (caldav_namespace, "valid-attendee-change"),
-                    "Cannot remove attendee",
-                ))
+                # Check that the attendee was listed in the old data
+                if self.resource is not None:
+                    oldattendess = self.oldcalendar.getAllUniqueAttendees()
+                    found_old = False
+                    for attendee in oldattendess:
+                        attendeePrincipal = self.calendar_home.directoryService().recordWithCalendarUserAddress(attendee)
+                        if attendeePrincipal and attendeePrincipal.uid == self.calendar_home.uid():
+                            found_old = True
+                            break
 
+                    if found_old:
+                        log.error("Cannot remove ATTENDEE: UID:%s" % (self.uid,))
+                        raise HTTPError(ErrorResponse(
+                            responsecode.FORBIDDEN,
+                            (caldav_namespace, "valid-attendee-change"),
+                            "Cannot remove attendee",
+                        ))
+
             # We will allow the attendee to do anything in this case, but we will mark the organizer
             # with an schedule-status error and schedule-agent none
             log.debug("Missing attendee is allowed to update UID: '{uid}' with invalid organizer '{organizer}'", uid=self.uid, organizer=self.organizer)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140306/f11d6b7b/attachment-0001.html>


More information about the calendarserver-changes mailing list