[CalendarServer-changes] [540]
CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/
static.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Nov 21 10:42:41 PST 2006
Revision: 540
http://trac.macosforge.org/projects/calendarserver/changeset/540
Author: cdaboo at apple.com
Date: 2006-11-21 10:42:41 -0800 (Tue, 21 Nov 2006)
Log Message:
-----------
Use default inbox privileges rather than provision via a property. Restore the inbox/outbox resource putChild behavior
so that we get the right resource types when traversing the hierarchy.
Modified Paths:
--------------
CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py
Modified: CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py 2006-11-21 18:39:48 UTC (rev 539)
+++ CalendarServer/branches/users/wsanchez/provisioning-2/twistedcaldav/static.py 2006-11-21 18:42:41 UTC (rev 540)
@@ -387,9 +387,25 @@
def http_MKCOL (self, request): return responsecode.FORBIDDEN
def http_MKCALENDAR (self, request): return responsecode.FORBIDDEN
+ ##
+ # ACL
+ ##
+
def supportedPrivileges(self, request):
return succeed(schedulePrivilegeSet)
+ def defaultAccessControlList(self):
+ return davxml.ACL(
+ # Allow any authenticated user to schedule
+ davxml.ACE(
+ davxml.Principal(davxml.Authenticated()),
+ davxml.Grant(
+ davxml.Privilege(caldavxml.Schedule()),
+ ),
+ ),
+ )
+
+
class ScheduleOutboxFile (ScheduleOutboxResource, CalDAVFile):
"""
L{CalDAVFile} calendar outbox collection resource.
@@ -580,6 +596,15 @@
self.record = record
self._parent = parent
+ # Cache children which must be of a specific type
+ for name, cls in (
+ ("inbox" , ScheduleInboxFile),
+ ("outbox", ScheduleOutboxFile),
+ ):
+ child_fp = self.fp.child(name)
+ child = cls(child_fp.path)
+ self.putChild(name, child)
+
def provisionOnCreate(self):
"""
Create all the child collections we need when the resource
@@ -596,16 +621,8 @@
if not child_fp.exists():
child_fp.makedirs()
if name == "inbox":
- child.setAccessControlList(
- davxml.ACL(
- davxml.ACE(
- davxml.Principal(davxml.Authenticated()),
- davxml.Grant(
- davxml.Privilege(caldavxml.Schedule()),
- ),
- ),
- )
- )
+ # FIXME: This should probably be a directory record option that maps to the property value
+ # directly without the need to store one.
if self.record.recordType == "resource":
# Resources should have autorespond turned on by default,
# since they typically don't have someone responding for them.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061121/618bcb9a/attachment.html
More information about the calendarserver-changes
mailing list