[CalendarServer-changes] [748] CalendarServer/branches/caldavd-twistd-plugin-2

source_changes at macosforge.org source_changes at macosforge.org
Thu Dec 7 13:41:39 PST 2006


Revision: 748
          http://trac.macosforge.org/projects/calendarserver/changeset/748
Author:   dreid at apple.com
Date:     2006-12-07 13:41:39 -0800 (Thu, 07 Dec 2006)

Log Message:
-----------
send directory.realmName if it's set, otherwise send an empty string, also set default ACLs on the root resource

Modified Paths:
--------------
    CalendarServer/branches/caldavd-twistd-plugin-2/conf/caldavd.plist
    CalendarServer/branches/caldavd-twistd-plugin-2/twistedcaldav/config.py
    CalendarServer/branches/caldavd-twistd-plugin-2/twistedcaldav/tap.py

Modified: CalendarServer/branches/caldavd-twistd-plugin-2/conf/caldavd.plist
===================================================================
--- CalendarServer/branches/caldavd-twistd-plugin-2/conf/caldavd.plist	2006-12-07 21:10:06 UTC (rev 747)
+++ CalendarServer/branches/caldavd-twistd-plugin-2/conf/caldavd.plist	2006-12-07 21:41:39 UTC (rev 748)
@@ -107,9 +107,13 @@
 
   <key>AuthSchemes</key>
   <array>
-<!--     <string>Digest</string> -->
     <string>Basic</string>
   </array>
 
+  <key>AdminPrincipals</key>
+  <array>
+    <string>/principals/users/admin</string>
+  </array>
+
 </dict>
 </plist>

Modified: CalendarServer/branches/caldavd-twistd-plugin-2/twistedcaldav/config.py
===================================================================
--- CalendarServer/branches/caldavd-twistd-plugin-2/twistedcaldav/config.py	2006-12-07 21:10:06 UTC (rev 747)
+++ CalendarServer/branches/caldavd-twistd-plugin-2/twistedcaldav/config.py	2006-12-07 21:41:39 UTC (rev 748)
@@ -53,6 +53,7 @@
     'twistdLocation': '/usr/share/caldavd/bin/twistd',
     'SACLEnable': True,
     'AuthSchemes': ['Basic'],
+    'AdminPrincipals': ['/principal/users/admin']
 }
 
 globs = globals()

Modified: CalendarServer/branches/caldavd-twistd-plugin-2/twistedcaldav/tap.py
===================================================================
--- CalendarServer/branches/caldavd-twistd-plugin-2/twistedcaldav/tap.py	2006-12-07 21:10:06 UTC (rev 747)
+++ CalendarServer/branches/caldavd-twistd-plugin-2/twistedcaldav/tap.py	2006-12-07 21:41:39 UTC (rev 748)
@@ -30,6 +30,7 @@
 from twisted.cred.portal import Portal
 
 from twisted.web2.dav import auth
+from twisted.web2.dav import davxml
 from twisted.web2.auth import basic
 from twisted.web2.channel import http
 
@@ -73,8 +74,6 @@
         # Setup the Directory
         #
 
-        print config.DirectoryService
-
         directoryClass = namedClass(config.DirectoryService['type'])
 
         directory = directoryClass(**config.DirectoryService['params'])
@@ -101,6 +100,21 @@
         root.putChild('principals', principalCollection)
         root.putChild('calendars', calendarCollection)
 
+        # Configure default ACLs on the root resource
+
+        rootACEs = [
+            davxml.ACE(
+                davxml.Principal(davxml.All()),
+                davxml.Grant(davxml.Privilege(davxml.Read()))),]
+
+        for principal in config.AdminPrincipals:
+            rootACEs.append(
+                davxml.ACE(
+                    davxml.Principal(davxml.HRef(principal)),
+                    davxml.Grant(davxml.Privilege(davxml.All()))))
+
+        root.setAccessControlList(davxml.ACL(*rootACEs))
+
         #
         # Configure the Site and Wrappers
         #
@@ -112,7 +126,8 @@
         portal.registerChecker(directory)
 
         # TODO: figure out the list of supported schemes from the directory
-        schemes = {'basic': basic.BasicCredentialFactory(""),
+        schemes = {'basic': basic.BasicCredentialFactory(directory.realmName
+                                                         or ""),
                    #'digest': digest.DigestCredentialFactory
                    }
 

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


More information about the calendarserver-changes mailing list