[CalendarServer-changes] [8213] CalendarServer/trunk/twistedcaldav/directory/principal.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Oct 20 10:06:21 PDT 2011


Revision: 8213
          http://trac.macosforge.org/projects/calendarserver/changeset/8213
Author:   sagen at apple.com
Date:     2011-10-20 10:06:21 -0700 (Thu, 20 Oct 2011)
Log Message:
-----------
Honor wiki ACL for principal URLs

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/directory/principal.py

Modified: CalendarServer/trunk/twistedcaldav/directory/principal.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/principal.py	2011-10-20 14:35:33 UTC (rev 8212)
+++ CalendarServer/trunk/twistedcaldav/directory/principal.py	2011-10-20 17:06:21 UTC (rev 8213)
@@ -68,6 +68,7 @@
 from twistedcaldav import caldavxml, customxml
 from twistedcaldav.customxml import calendarserver_namespace
 from twistedcaldav.scheduling.cuaddress import normalizeCUAddr
+from twistedcaldav.directory.wiki import getWikiACL
 
 thisModule = getModule(__name__)
 log = Logger()
@@ -77,13 +78,25 @@
     def defaultAccessControlList(self):
         return authReadACL
 
-    def accessControlList(self, request, inheritance=True, expanding=False,
-                          inherited_aces=None):
 
-        return succeed(self.defaultAccessControlList())
+    @inlineCallbacks
+    def accessControlList(self, request, inheritance=True, expanding=False, inherited_aces=None):
 
+        try:
+            wikiACL = (yield getWikiACL(self, request))
+        except HTTPError:
+            wikiACL = None
 
+        if wikiACL is not None:
+            # ACL depends on wiki server...
+            log.debug("Wiki ACL: %s" % (wikiACL.toxml(),))
+            returnValue(wikiACL)
+        else:
+            # ...otherwise permissions are fixed, and are not subject to
+            # inheritance rules, etc.
+            returnValue(self.defaultAccessControlList())
 
+
 # Converter methods for recordsMatchingFields()
 #
 # A DAV property can be associated with one of these converter methods,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111020/0016e72c/attachment.html>


More information about the calendarserver-changes mailing list