[CalendarServer-changes] [4784] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Nov 19 19:19:04 PST 2009


Revision: 4784
          http://trac.macosforge.org/projects/calendarserver/changeset/4784
Author:   cdaboo at apple.com
Date:     2009-11-19 19:19:03 -0800 (Thu, 19 Nov 2009)
Log Message:
-----------
Make sure SCHEDULE-STATUS error is set on non-scheduling attendee operations.

Modified Paths:
--------------
    CalendarServer/trunk/support/build.sh
    CalendarServer/trunk/twistedcaldav/scheduling/implicit.py
    CalendarServer/trunk/twistedcaldav/scheduling/itip.py

Modified: CalendarServer/trunk/support/build.sh
===================================================================
--- CalendarServer/trunk/support/build.sh	2009-11-20 03:17:16 UTC (rev 4783)
+++ CalendarServer/trunk/support/build.sh	2009-11-20 03:19:03 UTC (rev 4784)
@@ -496,7 +496,7 @@
     false true true true 212;
 
   # Tool dependencies.  The code itself doesn't depend on these, but you probably want them.
-  svn_get "CalDAVTester" "${top}/CalDAVTester" "${svn_uri_base}/CalDAVTester/trunk" 4761;
+  svn_get "CalDAVTester" "${top}/CalDAVTester" "${svn_uri_base}/CalDAVTester/trunk" 4783;
   svn_get "Pyflakes" "${top}/Pyflakes" http://divmod.org/svn/Divmod/trunk/Pyflakes 17198;
 }
 

Modified: CalendarServer/trunk/twistedcaldav/scheduling/implicit.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/implicit.py	2009-11-20 03:17:16 UTC (rev 4783)
+++ CalendarServer/trunk/twistedcaldav/scheduling/implicit.py	2009-11-20 03:19:03 UTC (rev 4784)
@@ -33,7 +33,7 @@
 from twistedcaldav.scheduling.cuaddress import InvalidCalendarUser,\
     LocalCalendarUser
 from twistedcaldav.scheduling.icaldiff import iCalDiff
-from twistedcaldav.scheduling.itip import iTipGenerator
+from twistedcaldav.scheduling.itip import iTipGenerator, iTIPRequestStatus
 from twistedcaldav.scheduling.scheduler import CalDAVScheduler
 from twistedcaldav.scheduling.utils import getCalendarObjectForPrincipals
 from twistedcaldav.directory.principal import DirectoryCalendarPrincipalResource
@@ -801,6 +801,8 @@
                 if not doITipReply:
                     log.debug("Implicit - attendee '%s' is updating UID: '%s' but change is not significant" % (self.attendee, self.uid))
                     returnValue(None)
+                log.debug("Attendee '%s' is allowed to update UID: '%s' with local organizer '%s'" % (self.attendee, self.uid, self.organizer))
+
             elif isinstance(self.organizerAddress, LocalCalendarUser):
                 # Check to see whether all instances are CANCELLED
                 if self.calendar.hasPropertyValueInAllComponents(Property("STATUS", "CANCELLED")):
@@ -811,14 +813,24 @@
                     log.debug("Attendee '%s' is not allowed to update UID: '%s' - missing organizer copy - removing entire event" % (self.attendee, self.uid,))
                     self.return_status = ImplicitScheduler.STATUS_ORPHANED_EVENT
                     returnValue(None)
+
             elif isinstance(self.organizerAddress, InvalidCalendarUser):
-                log.debug("Attendee '%s' is not allowed to update UID: '%s' with invalid organizer '%s'" % (self.attendee, self.uid, self.organizer))
-                raise HTTPError(ErrorResponse(responsecode.FORBIDDEN, (caldav_namespace, "valid-attendee-change")))
+                # We will allow the attendee to do anything in this case, but we will mark the organizer
+                # with an schedule-status error
+                log.debug("Attendee '%s' is allowed to update UID: '%s' with invalid organizer '%s'" % (self.attendee, self.uid, self.organizer))
+                self.calendar.setParameterToValueForPropertyWithValue(
+                    "SCHEDULE-STATUS",
+                    iTIPRequestStatus.NO_USER_SUPPORT_CODE,
+                    "ORGANIZER",
+                    self.organizer)
+                returnValue(None)
+
             else:
                 # We have a remote Organizer of some kind. For now we will allow the Attendee
                 # to make any change they like as we cannot verify what is reasonable. In reality
                 # we ought to be comparing the Attendee changes against the attendee's own copy
                 # and restrict changes based on that when the organizer's copy is not available.
+                log.debug("Attendee '%s' is allowed to update UID: '%s' with remote organizer '%s'" % (self.attendee, self.uid, self.organizer))
                 changedRids = None
 
             log.debug("Implicit - attendee '%s' is updating UID: '%s'" % (self.attendee, self.uid))

Modified: CalendarServer/trunk/twistedcaldav/scheduling/itip.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/itip.py	2009-11-20 03:17:16 UTC (rev 4783)
+++ CalendarServer/trunk/twistedcaldav/scheduling/itip.py	2009-11-20 03:19:03 UTC (rev 4784)
@@ -668,20 +668,30 @@
     String constants for various iTIP status codes we use.
     """
     
-    MESSAGE_PENDING_CODE    = "1.0"
-    MESSAGE_SENT_CODE       = "1.1"
-    MESSAGE_DELIVERED_CODE  = "1.2"
+    MESSAGE_PENDING_CODE        = "1.0"
+    MESSAGE_SENT_CODE           = "1.1"
+    MESSAGE_DELIVERED_CODE      = "1.2"
 
+    SUCCESS_CODE                = "2.0"
+
+    INVALID_CALENDAR_USER_CODE  = "3.7"
+    NO_AUTHORITY_CODE           = "3.8"
+
+    BAD_REQUEST_CODE            = "5.0"
+    SERVICE_UNAVAILABLE_CODE    = "5.1"
+    INVALID_SERVICE_CODE        = "5.2"
+    NO_USER_SUPPORT_CODE        = "5.3"
+
     MESSAGE_PENDING         = MESSAGE_PENDING_CODE + ";Scheduling message send is pending"
     MESSAGE_SENT            = MESSAGE_SENT_CODE + ";Scheduling message has been sent"
     MESSAGE_DELIVERED       = MESSAGE_DELIVERED_CODE + ";Scheduling message has been delivered"
     
-    SUCCESS                 = "2.0;Success"
+    SUCCESS                 = SUCCESS_CODE + ";Success"
 
-    INVALID_CALENDAR_USER   = "3.7;Invalid Calendar User"
-    NO_AUTHORITY            = "3.8;No authority"
+    INVALID_CALENDAR_USER   = INVALID_CALENDAR_USER_CODE + ";Invalid Calendar User"
+    NO_AUTHORITY            = NO_AUTHORITY_CODE + ";No authority"
 
-    BAD_REQUEST             = "5.0;Service cannot handle request"
-    SERVICE_UNAVAILABLE     = "5.1;Service unavailable"
-    INVALID_SERVICE         = "5.2;Invalid calendar service"
-    NO_USER_SUPPORT         = "5.3;No scheduling support for user"
+    BAD_REQUEST             = BAD_REQUEST_CODE + ";Service cannot handle request"
+    SERVICE_UNAVAILABLE     = SERVICE_UNAVAILABLE_CODE + ";Service unavailable"
+    INVALID_SERVICE         = INVALID_SERVICE_CODE + ";Invalid calendar service"
+    NO_USER_SUPPORT         = NO_USER_SUPPORT_CODE + ";No scheduling support for user"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20091119/64612267/attachment.html>


More information about the calendarserver-changes mailing list