[CalendarServer-changes] [575]
CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Wed Nov 22 16:05:44 PST 2006
Revision: 575
http://trac.macosforge.org/projects/calendarserver/changeset/575
Author: wsanchez at apple.com
Date: 2006-11-22 16:05:44 -0800 (Wed, 22 Nov 2006)
Log Message:
-----------
Undo r532.
principalCollections() is needed to bind the calendar tree with the
principals that populate it.
DirectoryRecord shouldn't need a principalResource() method.
Modified Paths:
--------------
CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py
CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py
Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py 2006-11-23 00:03:32 UTC (rev 574)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/directory/resource.py 2006-11-23 00:05:44 UTC (rev 575)
@@ -59,6 +59,9 @@
self._url = url
self.directory = IDirectoryService(directory)
+ # FIXME: Smells like a hack
+ directory.principalCollection = self
+
# Create children
for name in self.directory.recordTypes():
child_fp = self.fp.child(name)
Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py 2006-11-23 00:03:32 UTC (rev 574)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py 2006-11-23 00:05:44 UTC (rev 575)
@@ -494,6 +494,11 @@
def listChildren(self):
return self.directory.recordTypes()
+ def principalCollections(self, request):
+ # FIXME: directory.principalCollection smells like a hack
+ # See DirectoryPrincipalProvisioningResource.__init__()
+ return self.directory.principalCollection.principalCollections(request)
+
def homeForDirectoryRecord(self, record):
return self.getChild(record.recordType).getChild(record.shortName)
@@ -565,6 +570,9 @@
def defaultAccessControlList(self):
return readOnlyACL
+ def principalCollections(self, request):
+ return self._parent.principalCollections(request)
+
class CalendarHomeFile (CalDAVFile):
"""
L{CalDAVFile} calendar home collection resource.
@@ -667,9 +675,9 @@
##
def defaultAccessControlList(self):
- # Map from the record to the directory service, then to the principal
- # provisioning resource then to the principal.
- myPrincipal = self.record.principalResource()
+ # FIXME: directory.principalCollection smells like a hack
+ # See DirectoryPrincipalProvisioningResource.__init__()
+ myPrincipal = self._parent._parent.directory.principalCollection.principalForRecord(self.record)
return davxml.ACL(
# DAV:read access for authenticated users.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061122/e3d42384/attachment.html
More information about the calendarserver-changes
mailing list