[CalendarServer-changes] [13643]

source_changes at macosforge.org source_changes at macosforge.org
Tue Jun 17 03:08:02 PDT 2014


Revision: 13643
          http://trac.calendarserver.org//changeset/13643
Author:   gaya at apple.com
Date:     2014-06-17 03:08:02 -0700 (Tue, 17 Jun 2014)
Log Message:
-----------
use separate config options for addressbook and vcard group sharing. Add CalDAVTester "feature" for group sharing. Group sharing temporarily disabled for caldavtester testing.

Modified Paths:
--------------
    CalDAVTester/trunk/scripts/server/serverinfo.xml
    CalDAVTester/trunk/scripts/tests/CardDAV/sharing-access.xml
    CalDAVTester/trunk/scripts/tests/CardDAV/sharing-bulk.xml
    CalDAVTester/trunk/scripts/tests/CardDAV/sharing-groups.xml
    CalDAVTester/trunk/scripts/tests/CardDAV/sharing-put.xml
    CalDAVTester/trunk/scripts/tests/CardDAV/sharing-sync.xml
    CalDAVTester/trunk/scripts/tests/CardDAV/sharing-unshare.xml
    CalendarServer/trunk/twistedcaldav/resource.py
    CalendarServer/trunk/twistedcaldav/stdconfig.py
    CalendarServer/trunk/twistedcaldav/storebridge.py

Modified: CalDAVTester/trunk/scripts/server/serverinfo.xml
===================================================================
--- CalDAVTester/trunk/scripts/server/serverinfo.xml	2014-06-17 05:21:39 UTC (rev 13642)
+++ CalDAVTester/trunk/scripts/server/serverinfo.xml	2014-06-17 10:08:02 UTC (rev 13643)
@@ -110,6 +110,7 @@
 		<feature>carddav</feature> 						<!-- Basic CardDAV feature enabler -->
 		<feature>default-addressbook</feature> 			<!-- Default address book behavior -->
 		<feature>shared-addressbooks</feature>			<!-- Shared address books extension -->
+		<!-- <feature>shared-groups</feature> -->		<!-- Shared groups extension -->
 		<feature>directory-gateway</feature>			<!-- Directory gateway extension -->
 
 	</features>

Modified: CalDAVTester/trunk/scripts/tests/CardDAV/sharing-access.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/sharing-access.xml	2014-06-17 05:21:39 UTC (rev 13642)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/sharing-access.xml	2014-06-17 10:08:02 UTC (rev 13643)
@@ -489,6 +489,9 @@
 
 
 	<test-suite name='read-write shared group' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='0' ignore='no'>
 			<description>reset user1 home and share user2 group read-write</description>
 			<request user="$useradmin:" pswd="$pswdadmin:">
@@ -721,6 +724,9 @@
 
 
 	<test-suite name='read-only shared group' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='0' ignore='no'>
 			<description>reset user1 home and share user2 group 345 read-only</description>
 			<request user="$useradmin:" pswd="$pswdadmin:">
@@ -899,6 +905,9 @@
 	</test-suite>
 	
 	<test-suite name='overlapping read-only, read-write shared group' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='0' ignore='no'>
 			<description>reset user1 home and share user2 group g123 read-write, group 345 read-only</description>
 			<request user="$useradmin:" pswd="$pswdadmin:">
@@ -1227,6 +1236,9 @@
 	</test-suite>
 	
 	<test-suite name='overlapping read-only, read-write shared groups, read-write addressbook' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='0' ignore='no'>
 			<description>share user2 addressbook read-write</description>
 			<!-- user2 POSTs invitation -->
@@ -1371,6 +1383,9 @@
 	</test-suite>
 	
 	<test-suite name='overlapping read-only, read-write shared groups, read-only addressbook' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='0' ignore='no'>
 			<description>share user2 addressbook read-only</description>
 			<!-- user2 POSTs invitation -->
@@ -1477,6 +1492,9 @@
 	</test-suite>
 	
 	<test-suite name='add to ab with two read-write shared groups' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='0' ignore='no'>
 			<description>unshare address book, share 345 read-write</description>
 			<request>

Modified: CalDAVTester/trunk/scripts/tests/CardDAV/sharing-bulk.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/sharing-bulk.xml	2014-06-17 05:21:39 UTC (rev 13642)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/sharing-bulk.xml	2014-06-17 10:08:02 UTC (rev 13643)
@@ -25,6 +25,7 @@
 		<feature>carddav</feature>
 		<feature>bulk-post</feature>
 		<feature>shared-addressbooks</feature>
+		<feature>shared-groups</feature>
 	</require-feature>
 
 	<start>

Modified: CalDAVTester/trunk/scripts/tests/CardDAV/sharing-groups.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/sharing-groups.xml	2014-06-17 05:21:39 UTC (rev 13642)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/sharing-groups.xml	2014-06-17 10:08:02 UTC (rev 13643)
@@ -24,6 +24,7 @@
 	<require-feature>
 		<feature>carddav</feature>
 		<feature>shared-addressbooks</feature>
+		<feature>shared-groups</feature>
 	</require-feature>
 
 	<start>

Modified: CalDAVTester/trunk/scripts/tests/CardDAV/sharing-put.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/sharing-put.xml	2014-06-17 05:21:39 UTC (rev 13642)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/sharing-put.xml	2014-06-17 10:08:02 UTC (rev 13643)
@@ -24,6 +24,7 @@
 	<require-feature>
 		<feature>carddav</feature>
 		<feature>shared-addressbooks</feature>
+		<feature>shared-groups</feature>
 	</require-feature>
 
 	<start>

Modified: CalDAVTester/trunk/scripts/tests/CardDAV/sharing-sync.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/sharing-sync.xml	2014-06-17 05:21:39 UTC (rev 13642)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/sharing-sync.xml	2014-06-17 10:08:02 UTC (rev 13643)
@@ -919,6 +919,9 @@
 
 	<!-- test suite below is similar to test suite in ../CalDAV/sharing-sync.xml -->
 	<test-suite name='one shared group'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='0'>
 			<description>clean up old data</description>
 			<request user="$useradmin:" pswd="$pswdadmin:">
@@ -2234,6 +2237,9 @@
 
 	<!-- test suite below is similar to test suite in ../CalDAV/sharing-sync.xml -->
 	<test-suite name='two shared groups'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='0'>
 			<description>clean up old data</description>
 			<request user="$useradmin:" pswd="$pswdadmin:">

Modified: CalDAVTester/trunk/scripts/tests/CardDAV/sharing-unshare.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/sharing-unshare.xml	2014-06-17 05:21:39 UTC (rev 13642)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/sharing-unshare.xml	2014-06-17 10:08:02 UTC (rev 13643)
@@ -431,6 +431,9 @@
 	</test-suite>
 
 	<test-suite name='reshare addressbook, sharee delete addressbook group' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='1' ignore='no'>
 			<description>POST invitation</description>
 			<request print-response='no'>
@@ -1024,6 +1027,9 @@
 	</test-suite>
 
 	<test-suite name='create and share group, sharee decline' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='0' ignore='no'>
 			<description>cleanup and initialize</description>
 			<request user="$useradmin:" pswd="$pswdadmin:">
@@ -1264,6 +1270,9 @@
 	</test-suite>	
 
 	<test-suite name='reshare group, sharee delete addressbook' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='1' ignore='no'>
 			<description>POST invitation</description>
 			<request print-response='no'>
@@ -1461,6 +1470,9 @@
 	</test-suite>	
 
 	<test-suite name='reshare group, sharee delete group' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='1' ignore='no'>
 			<description>POST invitation</description>
 			<request print-response='no'>
@@ -1658,6 +1670,9 @@
 	</test-suite>	
 
 	<test-suite name='reshare group, sharer uninvite' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='1' ignore='no'>
 			<description>POST invitation</description>
 			<request print-response='no'>
@@ -1855,6 +1870,9 @@
 	</test-suite>	
 
 	<test-suite name='reshare group, sharer delete group' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='1' ignore='no'>
 			<description>POST invitation</description>
 			<request print-response='no'>
@@ -2053,6 +2071,9 @@
 	</test-suite>	
 
 	<test-suite name='recreate and share group, sharer delete addressbook' ignore='no'>
+		<require-feature>
+			<feature>shared-groups</feature>
+		</require-feature>
 		<test name='0' ignore='no'>
 			<request user="$userid1:" pswd="$pswd1:">
 				<method>PUT</method>

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2014-06-17 05:21:39 UTC (rev 13642)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2014-06-17 10:08:02 UTC (rev 13643)
@@ -476,7 +476,10 @@
                     customxml.SharedURL.qname(),
                 )
 
-            elif config.Sharing.AddressBooks.Enabled and (self.isAddressBookCollection() or self.isGroup()) and not self.isDirectoryBackedAddressBookCollection():
+            elif (
+                config.Sharing.AddressBooks.Enabled and self.isAddressBookCollection() or
+                config.Sharing.AddressBooks.Groups.Enabled and self.isGroup()
+            ) and not self.isDirectoryBackedAddressBookCollection():
                 baseProperties += (
                     customxml.Invite.qname(),
                     customxml.AllowedSharingModes.qname(),
@@ -676,17 +679,23 @@
 
         elif qname == customxml.Invite.qname():
             if config.Sharing.Enabled and (
-                config.Sharing.Calendars.Enabled and self.isCalendarCollection() or
-                config.Sharing.AddressBooks.Enabled and (self.isAddressBookCollection() or self.isGroup()) and not self.isDirectoryBackedAddressBookCollection()
+                config.Sharing.Calendars.Enabled and self.isCalendarCollection() or (
+                    config.Sharing.AddressBooks.Enabled and self.isAddressBookCollection() or
+                    config.Sharing.AddressBooks.Groups.Enabled and self.isGroup()
+                ) and not self.isDirectoryBackedAddressBookCollection()
             ):
                 result = (yield self.inviteProperty(request))
                 returnValue(result)
 
         elif qname == customxml.AllowedSharingModes.qname():
-            if config.Sharing.Enabled and config.Sharing.Calendars.Enabled and self.isCalendarCollection():
-                returnValue(customxml.AllowedSharingModes(customxml.CanBeShared()))
-            elif config.Sharing.Enabled and config.Sharing.AddressBooks.Enabled and (self.isAddressBookCollection() or self.isGroup()) and not self.isDirectoryBackedAddressBookCollection():
-                returnValue(customxml.AllowedSharingModes(customxml.CanBeShared()))
+            if config.Sharing.Enabled:
+                if config.Sharing.Calendars.Enabled and self.isCalendarCollection():
+                    returnValue(customxml.AllowedSharingModes(customxml.CanBeShared()))
+                elif (
+                    config.Sharing.AddressBooks.Enabled and self.isAddressBookCollection() or
+                    config.Sharing.AddressBooks.Groups.Enabled and self.isGroup()
+                ) and not self.isDirectoryBackedAddressBookCollection():
+                    returnValue(customxml.AllowedSharingModes(customxml.CanBeShared()))
 
         elif qname == customxml.SharedURL.qname():
             if self.isShareeResource():

Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/stdconfig.py	2014-06-17 05:21:39 UTC (rev 13642)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py	2014-06-17 10:08:02 UTC (rev 13643)
@@ -631,6 +631,9 @@
                 "Global": [
                 ],
             },
+            "Groups" : {
+                "Enabled"         : False, # Address Books on/off switch
+            },
         },
     },
 

Modified: CalendarServer/trunk/twistedcaldav/storebridge.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/storebridge.py	2014-06-17 05:21:39 UTC (rev 13642)
+++ CalendarServer/trunk/twistedcaldav/storebridge.py	2014-06-17 10:08:02 UTC (rev 13643)
@@ -3570,7 +3570,11 @@
 
 
     def canBeShared(self):
-        return config.Sharing.Enabled and config.Sharing.AddressBooks.Enabled
+        return (
+            config.Sharing.Enabled and
+            config.Sharing.AddressBooks.Enabled and
+            config.Sharing.AddressBooks.Groups.Enabled
+        )
 
 
     @inlineCallbacks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140617/258863aa/attachment-0001.html>


More information about the calendarserver-changes mailing list