[CalendarServer-changes] [15156] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue Sep 29 01:27:21 PDT 2015


Revision: 15156
          http://trac.calendarserver.org//changeset/15156
Author:   cdaboo at apple.com
Date:     2015-09-29 01:27:20 -0700 (Tue, 29 Sep 2015)
Log Message:
-----------
Support for server-info document - off by default.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tap/util.py
    CalendarServer/trunk/requirements-dev.txt
    CalendarServer/trunk/twistedcaldav/extensions.py
    CalendarServer/trunk/twistedcaldav/resource.py
    CalendarServer/trunk/twistedcaldav/stdconfig.py
    CalendarServer/trunk/txweb2/dav/method/propfind.py
    CalendarServer/trunk/txweb2/dav/resource.py

Added Paths:
-----------
    CalendarServer/trunk/twistedcaldav/serverinfo.py
    CalendarServer/trunk/twistedcaldav/serverinfoxml.py

Modified: CalendarServer/trunk/calendarserver/tap/util.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/util.py	2015-09-29 08:12:33 UTC (rev 15155)
+++ CalendarServer/trunk/calendarserver/tap/util.py	2015-09-29 08:27:20 UTC (rev 15156)
@@ -72,6 +72,7 @@
 from twistedcaldav.directory.principal import DirectoryPrincipalProvisioningResource
 from twistedcaldav.directorybackedaddressbook import DirectoryBackedAddressBookResource
 from twistedcaldav.resource import AuthenticationWrapper
+from twistedcaldav.serverinfo import ServerInfoResource
 from twistedcaldav.simpleresource import SimpleResource, SimpleRedirectResource, \
     SimpleUnavailableResource
 from twistedcaldav.stdconfig import config
@@ -421,6 +422,7 @@
     addressBookResourceClass = DirectoryAddressBookHomeProvisioningResource
     directoryBackedAddressBookResourceClass = DirectoryBackedAddressBookResource
     apnSubscriptionResourceClass = APNSubscriptionResource
+    serverInfoResourceClass = ServerInfoResource
     principalResourceClass = DirectoryPrincipalProvisioningResource
     controlResourceClass = ControlAPIResource
 
@@ -743,6 +745,17 @@
         apnResource = apnSubscriptionResourceClass(root, newStore)
         root.putChild(apnConfig["SubscriptionURL"], apnResource)
 
+    # Server info document
+    if config.EnableServerInfo:
+        log.info(
+            "Setting up server-info resource: {cls}",
+            cls=serverInfoResourceClass)
+
+        serverInfo = serverInfoResourceClass(
+            root,
+        )
+        root.putChild("server-info", serverInfo)
+
     #
     # Configure ancillary data
     #

Modified: CalendarServer/trunk/requirements-dev.txt
===================================================================
--- CalendarServer/trunk/requirements-dev.txt	2015-09-29 08:12:33 UTC (rev 15155)
+++ CalendarServer/trunk/requirements-dev.txt	2015-09-29 08:27:20 UTC (rev 15156)
@@ -8,4 +8,4 @@
 q
 tl.eggdeps
 --editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVClientLibrary/trunk@14856#egg=CalDAVClientLibrary
---editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVTester/trunk@15151#egg=CalDAVTester
+--editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVTester/trunk@15155#egg=CalDAVTester

Modified: CalendarServer/trunk/twistedcaldav/extensions.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/extensions.py	2015-09-29 08:12:33 UTC (rev 15155)
+++ CalendarServer/trunk/twistedcaldav/extensions.py	2015-09-29 08:27:20 UTC (rev 15156)
@@ -76,6 +76,22 @@
 log = Logger()
 
 
+class WebDAVServerInfoMixIn(object):
+
+    def renderHTTP(self, request):
+        def _addServerInfoToken(request, response):
+            # server-info-token processing
+            if config.EnableServerInfo and (
+                request.headers.hasHeader("server-info-token") or
+                request.method == "OPTIONS"
+            ):
+                response.headers.setRawHeaders("server-info-token", (config.ServerInfoToken,))
+            return response
+        request.addResponseFilter(_addServerInfoToken, onlyOnce=True)
+        return super(WebDAVServerInfoMixIn, self).renderHTTP(request)
+
+
+
 class DirectoryPrincipalPropertySearchMixIn(object):
 
     @inlineCallbacks
@@ -583,9 +599,13 @@
 
 
 
-class DAVResource (DirectoryPrincipalPropertySearchMixIn,
-                   SuperDAVResource,
-                   DirectoryRenderingMixIn, StaticRenderMixin):
+class DAVResource (
+    WebDAVServerInfoMixIn,
+    DirectoryPrincipalPropertySearchMixIn,
+    SuperDAVResource,
+    DirectoryRenderingMixIn,
+    StaticRenderMixin
+):
     """
     Extended L{txweb2.dav.resource.DAVResource} implementation.
 
@@ -712,9 +732,12 @@
 
 
 
-class DAVPrincipalResource (DirectoryPrincipalPropertySearchMixIn,
-                            SuperDAVPrincipalResource,
-                            DirectoryRenderingMixIn):
+class DAVPrincipalResource (
+    WebDAVServerInfoMixIn,
+    DirectoryPrincipalPropertySearchMixIn,
+    SuperDAVPrincipalResource,
+    DirectoryRenderingMixIn
+):
     """
     Extended L{txweb2.dav.static.DAVFile} implementation.
     """
@@ -811,7 +834,7 @@
 
 
 
-class DAVFile (SuperDAVFile, DirectoryRenderingMixIn):
+class DAVFile (WebDAVServerInfoMixIn, SuperDAVFile, DirectoryRenderingMixIn):
     """
     Extended L{txweb2.dav.static.DAVFile} implementation.
     """

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2015-09-29 08:12:33 UTC (rev 15155)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2015-09-29 08:27:20 UTC (rev 15156)
@@ -39,6 +39,7 @@
 
 from twistedcaldav import caldavxml, customxml
 from twistedcaldav import carddavxml
+from twistedcaldav import serverinfoxml
 from twistedcaldav import ical
 from twistedcaldav.cache import PropfindCacheMixin
 from twistedcaldav.caldavxml import caldav_namespace
@@ -59,7 +60,7 @@
 from txdav.common.icommondatastore import InternalDataStoreError, \
     SyncTokenValidException
 from txdav.xml import element
-from txdav.xml.element import dav_namespace
+from txdav.xml.element import dav_namespace, HRef
 
 from txweb2 import responsecode, http, http_headers
 from txweb2.auth.wrapper import UnauthorizedResponse
@@ -554,6 +555,10 @@
                     customxml.AllowedSharingModes.qname(),
                 )
 
+        if config.EnableServerInfo:
+            baseProperties += (serverinfoxml.ServerInfoHref.qname(),)
+
+
         return super(CalDAVResource, self).liveProperties() + baseProperties
 
 
@@ -704,6 +709,11 @@
             else:
                 returnValue(None)
 
+
+        elif qname == serverinfoxml.ServerInfoHref.qname():
+            if config.EnableServerInfo:
+                returnValue(serverinfoxml.ServerInfoHref(HRef.fromString("/server-info")))
+
         result = (yield super(CalDAVResource, self).readProperty(property, request))
         returnValue(result)
 
@@ -2446,13 +2456,6 @@
         returnValue((storeHome, created))
 
 
-    def davComplianceClasses(self):
-        compliance = tuple(super(CalendarHomeResource, self).davComplianceClasses())
-        if config.EnableTimezonesByReference:
-            compliance += caldavxml.caldav_timezone_service_set_compliance
-        return compliance
-
-
     def liveProperties(self):
 
         existing = super(CalendarHomeResource, self).liveProperties()

Added: CalendarServer/trunk/twistedcaldav/serverinfo.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/serverinfo.py	                        (rev 0)
+++ CalendarServer/trunk/twistedcaldav/serverinfo.py	2015-09-29 08:27:20 UTC (rev 15156)
@@ -0,0 +1,257 @@
+##
+# Copyright (c) 2015 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+from twisted.internet.defer import inlineCallbacks, succeed, returnValue
+from twistedcaldav import caldavxml, carddavxml, mkcolxml
+from twistedcaldav import customxml
+from twistedcaldav.caldavxml import caldav_namespace
+from twistedcaldav.carddavxml import carddav_namespace
+from twistedcaldav.customxml import calendarserver_namespace
+from txdav.xml import element as davxml
+from txdav.xml.element import dav_namespace, WebDAVUnknownElement
+from txweb2.dav.noneprops import NonePropertyStore
+from txweb2.http_headers import MimeType, ETag
+from twistedcaldav.resource import ReadOnlyNoCopyResourceMixIn
+from twistedcaldav.extensions import DAVResource, \
+    DAVResourceWithoutChildrenMixin
+from txweb2.http import XMLResponse
+from twistedcaldav.config import config
+from txweb2 import responsecode
+import hashlib
+from twistedcaldav.serverinfoxml import Class1_Feature, AccessControl_Feature, \
+    Quota_Feature, SyncCollection_Feature, AddMember_Feature, Name_Service, \
+    Features, ServerInfo, Token, Applications, Application
+
+"""
+draft-douglass-server-info: "DAV Server Information Object"
+"""
+
+def buildServerInfo(config):
+    """
+    Build the DAV compliance header, server-info document, and server-info-token value
+    based on the supplied L{config}.
+
+    @param config: config to use
+    @type config: L{twistedcaldav.config}
+
+    @return: tuple of three items: compliance value, server-info XML document root
+        element, server-info-token value
+    @rtype: L{tuple}
+    """
+    global_features = [
+        Class1_Feature(),
+        AccessControl_Feature(),
+        Quota_Feature(),
+        SyncCollection_Feature(),
+        AddMember_Feature(),
+    ]
+    compliance = ()
+    applications = []
+    if config.EnableCalDAV:
+        if config.Scheduling.CalDAV.OldDraftCompatibility:
+            compliance = caldavxml.caldav_full_compliance
+        else:
+            compliance = caldavxml.caldav_implicit_compliance
+        features = [
+            WebDAVUnknownElement.withName(caldav_namespace, "calendar-access"),
+            WebDAVUnknownElement.withName(caldav_namespace, "calendar-auto-schedule"),
+            WebDAVUnknownElement.withName(calendarserver_namespace, "calendar-availability"),
+            WebDAVUnknownElement.withName(calendarserver_namespace, "inbox-availability"),
+        ]
+
+        if config.EnableProxyPrincipals:
+            compliance += customxml.calendarserver_proxy_compliance
+            features.append(WebDAVUnknownElement.withName(calendarserver_namespace, customxml.calendarserver_proxy_compliance[0]))
+
+        if config.EnablePrivateEvents:
+            compliance += customxml.calendarserver_private_events_compliance
+            features.append(WebDAVUnknownElement.withName(calendarserver_namespace, customxml.calendarserver_private_events_compliance[0]))
+
+        if config.Scheduling.CalDAV.EnablePrivateComments:
+            compliance += customxml.calendarserver_private_comments_compliance
+            features.append(WebDAVUnknownElement.withName(calendarserver_namespace, customxml.calendarserver_private_comments_compliance[0]))
+
+        if config.Sharing.Enabled:
+            compliance += customxml.calendarserver_sharing_compliance
+            # TODO: This is only needed whilst we do not support scheduling in shared calendars
+            compliance += customxml.calendarserver_sharing_no_scheduling_compliance
+            if config.Sharing.Calendars.Enabled and config.Sharing.Calendars.Groups.Enabled:
+                compliance += customxml.calendarserver_group_sharee_compliance
+
+            sharing = WebDAVUnknownElement.withName(calendarserver_namespace, customxml.calendarserver_sharing_compliance[0])
+            # TODO: This is only needed whilst we do not support scheduling in shared calendars
+            sharing.children += (WebDAVUnknownElement.withName(calendarserver_namespace, customxml.calendarserver_sharing_no_scheduling_compliance[0]),)
+            if config.Sharing.Calendars.Enabled and config.Sharing.Calendars.Groups.Enabled:
+                sharing.children += (WebDAVUnknownElement.withName(calendarserver_namespace, customxml.calendarserver_group_sharee_compliance[0]),)
+            features.append(sharing)
+
+        if config.EnableCalendarQueryExtended:
+            compliance += caldavxml.caldav_query_extended_compliance
+            features.append(WebDAVUnknownElement.withName(caldav_namespace, caldavxml.caldav_query_extended_compliance[0]))
+
+        if config.EnableDefaultAlarms:
+            compliance += caldavxml.caldav_default_alarms_compliance
+            features.append(WebDAVUnknownElement.withName(caldav_namespace, caldavxml.caldav_default_alarms_compliance[0]))
+
+        if config.EnableManagedAttachments:
+            compliance += caldavxml.caldav_managed_attachments_compliance
+            features.append(WebDAVUnknownElement.withName(caldav_namespace, caldavxml.caldav_managed_attachments_compliance[0]))
+
+        if config.Scheduling.Options.TimestampAttendeePartStatChanges:
+            compliance += customxml.calendarserver_partstat_changes_compliance
+            features.append(WebDAVUnknownElement.withName(calendarserver_namespace, customxml.calendarserver_partstat_changes_compliance[0]))
+
+        if config.GroupAttendees.Enabled:
+            compliance += customxml.calendarserver_group_attendee_compliance
+            features.append(WebDAVUnknownElement.withName(calendarserver_namespace, customxml.calendarserver_group_attendee_compliance[0]))
+
+        if config.EnableTimezonesByReference:
+            compliance += caldavxml.caldav_timezones_by_reference_compliance
+            features.append(WebDAVUnknownElement.withName(caldav_namespace, caldavxml.caldav_timezones_by_reference_compliance[0]))
+
+        compliance += customxml.calendarserver_recurrence_split
+        features.append(WebDAVUnknownElement.withName(calendarserver_namespace, customxml.calendarserver_recurrence_split[0]))
+
+        applications.append(
+            Application(
+                Name_Service.fromString("caldav"),
+                Features(*features),
+            )
+        )
+
+    if config.EnableCardDAV:
+        compliance += carddavxml.carddav_compliance
+        features = [
+            WebDAVUnknownElement.withName(carddav_namespace, "addressbook"),
+        ]
+
+        applications.append(
+            Application(
+                Name_Service.fromString("carddav"),
+                Features(*features),
+            )
+        )
+
+    if config.EnableCardDAV:
+        compliance += carddavxml.carddav_compliance
+
+    if config.EnableCalDAV or config.EnableCardDAV:
+        compliance += mkcolxml.mkcol_compliance
+        global_features.append(WebDAVUnknownElement.withName(dav_namespace, mkcolxml.mkcol_compliance[0]))
+
+    # Principal property search is always enabled
+    compliance += customxml.calendarserver_principal_property_search_compliance
+    global_features.append(WebDAVUnknownElement.withName(calendarserver_namespace, customxml.calendarserver_principal_property_search_compliance[0]))
+
+    compliance += customxml.calendarserver_principal_search_compliance
+    global_features.append(WebDAVUnknownElement.withName(calendarserver_namespace, customxml.calendarserver_principal_search_compliance[0]))
+
+    # Home Depth:1 sync report will include WebDAV property changes on home child resources
+    compliance += customxml.calendarserver_home_sync_compliance
+
+    def _createServerInfo(token):
+        return ServerInfo(
+            Token.fromString(token),
+            Features(*global_features),
+            Applications(*applications)
+        )
+
+    token = hashlib.md5(_createServerInfo("").toxml()).hexdigest()
+
+    return compliance, _createServerInfo(token), token
+
+
+
+class ServerInfoResource (ReadOnlyNoCopyResourceMixIn, DAVResourceWithoutChildrenMixin, DAVResource):
+    """
+    Server-info resource.
+
+    Extends L{DAVResource} to allow server-info document retrieval.
+    """
+
+    def __init__(self, parent):
+        """
+        @param parent: the parent resource of this one.
+        """
+        assert parent is not None
+
+        DAVResource.__init__(self, principalCollections=parent.principalCollections())
+
+        self.parent = parent
+
+
+    def deadProperties(self):
+        if not hasattr(self, "_dead_properties"):
+            self._dead_properties = NonePropertyStore(self)
+        return self._dead_properties
+
+
+    def etag(self):
+        return succeed(ETag(config.ServerInfoToken))
+
+
+    def checkPreconditions(self, request):
+        return None
+
+
+    def checkPrivileges(self, request, privileges, recurse=False, principal=None, inherited_aces=None):
+        return succeed(None)
+
+
+    def defaultAccessControlList(self):
+        return succeed(
+            davxml.ACL(
+                # DAV:Read for all principals (includes anonymous)
+                davxml.ACE(
+                    davxml.Principal(davxml.All()),
+                    davxml.Grant(
+                        davxml.Privilege(davxml.Read()),
+                    ),
+                    davxml.Protected(),
+                ),
+            )
+        )
+
+
+    def contentType(self):
+        return MimeType.fromString("text/xml; charset=utf-8")
+
+
+    def resourceType(self):
+        return None
+
+
+    def isCollection(self):
+        return False
+
+
+    def isCalendarCollection(self):
+        return False
+
+
+    def isPseudoCalendarCollection(self):
+        return False
+
+
+    @inlineCallbacks
+    def http_GET(self, request):
+        """
+        The server-info GET method.
+        """
+
+        yield self.authorize(request, (davxml.Read(),))
+
+        returnValue(XMLResponse(responsecode.OK, config.ServerInfo))

Added: CalendarServer/trunk/twistedcaldav/serverinfoxml.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/serverinfoxml.py	                        (rev 0)
+++ CalendarServer/trunk/twistedcaldav/serverinfoxml.py	2015-09-29 08:27:20 UTC (rev 15156)
@@ -0,0 +1,152 @@
+##
+# Copyright (c) 2015 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+from txdav.xml.element import WebDAVElement, dav_namespace, registerElement, \
+    WebDAVTextElement, WebDAVEmptyElement, Bind, \
+    SyncCollection, AddMember
+
+ at registerElement
+class ServerInfoHref (WebDAVElement):
+    namespace = dav_namespace
+    name = "server-info-href"
+    hidden = True
+    protected = True
+    allowed_children = {
+        (dav_namespace, "href"): (0, 1),
+    }
+
+
+
+ at registerElement
+class ServerInfo (WebDAVElement):
+    namespace = dav_namespace
+    name = "server-info"
+    allowed_children = {
+        (dav_namespace, "token"): (1, 1),
+        (dav_namespace, "features"): (0, 1),
+        (dav_namespace, "services"): (0, 1),
+    }
+
+
+
+ at registerElement
+class Token (WebDAVTextElement):
+    namespace = dav_namespace
+    name = "token"
+
+
+
+ at registerElement
+class Features (WebDAVElement):
+    namespace = dav_namespace
+    name = "features"
+    allowed_children = {}
+
+
+
+ at registerElement
+class Applications (WebDAVElement):
+    namespace = dav_namespace
+    name = "applications"
+    allowed_children = {
+        (dav_namespace, "application"): (0, None),
+    }
+
+
+
+ at registerElement
+class Application (WebDAVElement):
+    namespace = dav_namespace
+    name = "application"
+    allowed_children = {
+        (dav_namespace, "name"): (1, 1),
+        (dav_namespace, "features"): (1, 1),
+    }
+
+
+
+ at registerElement
+class Name_Service (WebDAVTextElement):
+    namespace = dav_namespace
+    name = "name"
+
+
+
+ at registerElement
+class Class1_Feature (WebDAVEmptyElement):
+    namespace = dav_namespace
+    name = "class-1"
+
+
+
+ at registerElement
+class Class2_Feature (WebDAVEmptyElement):
+    namespace = dav_namespace
+    name = "class-2"
+
+
+
+ at registerElement
+class Class3_Feature (WebDAVEmptyElement):
+    namespace = dav_namespace
+    name = "class-3"
+
+
+
+ at registerElement
+class AccessControl_Feature (WebDAVEmptyElement):
+    namespace = dav_namespace
+    name = "access-control"
+
+
+
+ at registerElement
+class VersionControl_Feature (WebDAVEmptyElement):
+    namespace = dav_namespace
+    name = "version-control"
+
+
+
+ at registerElement
+class ExtendedMkcol_Feature (WebDAVEmptyElement):
+    namespace = dav_namespace
+    name = "extended-mkcol"
+
+
+
+ at registerElement
+class Quota_Feature (WebDAVEmptyElement):
+    namespace = dav_namespace
+    name = "quota"
+
+
+
+Bind_Feature = Bind
+
+
+
+ at registerElement
+class Search_Feature (WebDAVEmptyElement):
+    namespace = dav_namespace
+    name = "search"
+
+
+
+SyncCollection_Feature = SyncCollection
+
+
+
+AddMember_Feature = AddMember

Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/stdconfig.py	2015-09-29 08:12:33 UTC (rev 15155)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py	2015-09-29 08:27:20 UTC (rev 15156)
@@ -33,7 +33,6 @@
 from twisted.python.filepath import FilePath
 from twisted.python.runtime import platform
 
-from twistedcaldav import caldavxml, customxml, carddavxml, mkcolxml
 from twistedcaldav import ical
 from twistedcaldav.config import ConfigProvider, ConfigurationError, ConfigDict
 from twistedcaldav.config import config, mergeData, fullServerPath
@@ -516,6 +515,8 @@
 
     "EnableManagedAttachments"    : False, # Support Managed Attachments
 
+    "EnableServerInfo"            : False, # server-info document
+
     #
     # Generic CalDAV/CardDAV extensions
     #
@@ -1750,56 +1751,12 @@
 
 
 def _updateCompliance(configDict, reloading=False):
+    from twistedcaldav.serverinfo import buildServerInfo
+    (configDict.CalDAVComplianceClasses,
+        configDict.ServerInfo,
+        configDict.ServerInfoToken) = buildServerInfo(configDict)
 
-    if configDict.EnableCalDAV:
-        if configDict.Scheduling.CalDAV.OldDraftCompatibility:
-            compliance = caldavxml.caldav_full_compliance
-        else:
-            compliance = caldavxml.caldav_implicit_compliance
-        if configDict.EnableProxyPrincipals:
-            compliance += customxml.calendarserver_proxy_compliance
-        if configDict.EnablePrivateEvents:
-            compliance += customxml.calendarserver_private_events_compliance
-        if configDict.Scheduling.CalDAV.EnablePrivateComments:
-            compliance += customxml.calendarserver_private_comments_compliance
-        if config.Sharing.Enabled:
-            compliance += customxml.calendarserver_sharing_compliance
-            # TODO: This is only needed whilst we do not support scheduling in shared calendars
-            compliance += customxml.calendarserver_sharing_no_scheduling_compliance
-            if config.Sharing.Calendars.Enabled and config.Sharing.Calendars.Groups.Enabled:
-                compliance += customxml.calendarserver_group_sharee_compliance
-        if configDict.EnableCalendarQueryExtended:
-            compliance += caldavxml.caldav_query_extended_compliance
-        if configDict.EnableDefaultAlarms:
-            compliance += caldavxml.caldav_default_alarms_compliance
-        if configDict.EnableManagedAttachments:
-            compliance += caldavxml.caldav_managed_attachments_compliance
-        if configDict.Scheduling.Options.TimestampAttendeePartStatChanges:
-            compliance += customxml.calendarserver_partstat_changes_compliance
-        if config.GroupAttendees.Enabled:
-            compliance += customxml.calendarserver_group_attendee_compliance
-        if configDict.EnableTimezonesByReference:
-            compliance += caldavxml.caldav_timezones_by_reference_compliance
-        compliance += customxml.calendarserver_recurrence_split
-    else:
-        compliance = ()
 
-    if configDict.EnableCardDAV:
-        compliance += carddavxml.carddav_compliance
-
-    if configDict.EnableCalDAV or configDict.EnableCardDAV:
-        compliance += mkcolxml.mkcol_compliance
-
-    # Principal property search is always enabled
-    compliance += customxml.calendarserver_principal_property_search_compliance
-    compliance += customxml.calendarserver_principal_search_compliance
-
-    # Home Depth:1 sync report will include WebDAV property changes on home child resources
-    compliance += customxml.calendarserver_home_sync_compliance
-
-    configDict.CalDAVComplianceClasses = compliance
-
-
 PRE_UPDATE_HOOKS = (
     _preUpdateDirectoryService,
     _preUpdateResourceService,

Modified: CalendarServer/trunk/txweb2/dav/method/propfind.py
===================================================================
--- CalendarServer/trunk/txweb2/dav/method/propfind.py	2015-09-29 08:12:33 UTC (rev 15155)
+++ CalendarServer/trunk/txweb2/dav/method/propfind.py	2015-09-29 08:27:20 UTC (rev 15156)
@@ -171,9 +171,12 @@
                 properties_to_enumerate = search_properties
 
             for property in properties_to_enumerate:
-                has = waitForDeferred(resource.hasProperty(property, request))
-                yield has
-                has = has.getResult()
+                if hasattr(resource, "hasProperty"):
+                    has = waitForDeferred(resource.hasProperty(property, request))
+                    yield has
+                    has = has.getResult()
+                else:
+                    has = False
                 if has:
                     try:
                         resource_property = waitForDeferred(resource.readProperty(property, request))

Modified: CalendarServer/trunk/txweb2/dav/resource.py
===================================================================
--- CalendarServer/trunk/txweb2/dav/resource.py	2015-09-29 08:12:33 UTC (rev 15155)
+++ CalendarServer/trunk/txweb2/dav/resource.py	2015-09-29 08:27:20 UTC (rev 15156)
@@ -660,7 +660,7 @@
             reactor.callLater(0, getChild)
 
         def checkPrivileges(child):
-            if child is None:
+            if child is None or not hasattr(child, "checkPrivileges"):
                 return None
 
             if privileges is None:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150929/1be941e1/attachment-0001.html>


More information about the calendarserver-changes mailing list