[CalendarServer-changes] [12832] CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav /datastore/scheduling/implicit.py

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


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

Modified Paths:
--------------
    CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/implicit.py

Modified: CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/implicit.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/implicit.py	2014-03-06 23:04:29 UTC (rev 12831)
+++ CalendarServer/branches/release/CalendarServer-5.2-dev/txdav/caldav/datastore/scheduling/implicit.py	2014-03-06 23:05:06 UTC (rev 12832)
@@ -1221,15 +1221,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:%s" % (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: '%s' with invalid organizer '%s'" % (self.uid, self.organizer))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140306/47f13761/attachment.html>


More information about the calendarserver-changes mailing list