[CalendarServer-changes] [1436] CalendarServer/branches/users/cdaboo/fast-multiget-1425/ twistedcaldav/extensions.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Mar 30 13:35:13 PDT 2007


Revision: 1436
          http://trac.macosforge.org/projects/calendarserver/changeset/1436
Author:   cdaboo at apple.com
Date:     2007-03-30 13:35:13 -0700 (Fri, 30 Mar 2007)

Log Message:
-----------
Add comments. Allow callbacks to be None.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/fast-multiget-1425/twistedcaldav/extensions.py

Modified: CalendarServer/branches/users/cdaboo/fast-multiget-1425/twistedcaldav/extensions.py
===================================================================
--- CalendarServer/branches/users/cdaboo/fast-multiget-1425/twistedcaldav/extensions.py	2007-03-30 17:14:48 UTC (rev 1435)
+++ CalendarServer/branches/users/cdaboo/fast-multiget-1425/twistedcaldav/extensions.py	2007-03-30 20:35:13 UTC (rev 1436)
@@ -81,6 +81,17 @@
 
         This implementation works for C{depth} values of C{"0"}, C{"1"}, 
         and C{"infinity"}.  As long as C{self.listChildren} is implemented
+        
+        @param depth: a C{str} for the depth: "0", "1" and "infinity" only allowed.
+        @param request: the L{Request} for the current request in progress
+        @param okcallback: a callback function used on all resources that pass the privilege check,
+            or C{None}
+        @param badcallback: a callback function used on all resources that fail the privilege check,
+            or C{None}
+        @param names: a C{list} of C{str}'s containing the names of the child resources to lookup. If
+            empty or C{None} all children will be examined, otherwise only the ones in the list.
+        @param privileges: a list of privileges to check.
+        @param inherited_aces: the list of parent ACEs that are inherited by all children.
         """
         assert depth in ("0", "1", "infinity"), "Invalid depth: %s" % (depth,)
 
@@ -131,12 +142,14 @@
             checked = checked.getResult()
             if checked:
                 for resource, url in items[2]:
-                    okcallback(resource, url)
+                    if okcallback:
+                        okcallback(resource, url)
                     if resource.isCollection():
                         allowed_collections.append((resource, url))
             else:
-                for resource, url in items[2]:
-                    badcallback(resource, url)
+                if badcallback:
+                    for resource, url in items[2]:
+                        badcallback(resource, url)
 
         # TODO: Depth: inifinity support
         if depth == "infinity":

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070330/b84b89e1/attachment.html


More information about the calendarserver-changes mailing list