[CalendarServer-changes] [12828] twext/trunk/twext/who

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 5 20:17:29 PST 2014


Revision: 12828
          http://trac.calendarserver.org//changeset/12828
Author:   sagen at apple.com
Date:     2014-03-05 20:17:29 -0800 (Wed, 05 Mar 2014)
Log Message:
-----------
Add addMembers, removeMembers, setMembers to IDirectoryRecord

Modified Paths:
--------------
    twext/trunk/twext/who/directory.py
    twext/trunk/twext/who/idirectory.py

Modified: twext/trunk/twext/who/directory.py
===================================================================
--- twext/trunk/twext/who/directory.py	2014-03-06 02:54:11 UTC (rev 12827)
+++ twext/trunk/twext/who/directory.py	2014-03-06 04:17:29 UTC (rev 12828)
@@ -270,17 +270,21 @@
 
     @inlineCallbacks
     def recordWithShortName(self, recordType, shortName):
-        returnValue(uniqueResult((
-            yield self.recordsFromExpression(
-                CompoundExpression(
-                    (
-                        MatchExpression(FieldName.recordType, recordType),
-                        MatchExpression(FieldName.shortNames, shortName),
-                    ),
-                    operand=Operand.AND
+        returnValue(
+            uniqueResult(
+                (
+                    yield self.recordsFromExpression(
+                        CompoundExpression(
+                            (
+                                MatchExpression(FieldName.recordType, recordType),
+                                MatchExpression(FieldName.shortNames, shortName),
+                            ),
+                            operand=Operand.AND
+                        )
+                    )
                 )
             )
-        )))
+        )
 
 
     def recordsWithEmailAddress(self, emailAddress):
@@ -500,6 +504,18 @@
         return fail(NotImplementedError("Subclasses must implement groups()"))
 
 
+    def addMembers(self, members):
+        return fail(NotAllowedError("Membership updates not allowed."))
+
+
+    def removeMembers(self, members):
+        return fail(NotAllowedError("Membership updates not allowed."))
+
+
+    def setMembers(self, members):
+        return fail(NotAllowedError("Membership updates not allowed."))
+
+
     #
     # Verifiers for twext.who.checker stuff.
     #

Modified: twext/trunk/twext/who/idirectory.py
===================================================================
--- twext/trunk/twext/who/idirectory.py	2014-03-06 02:54:11 UTC (rev 12827)
+++ twext/trunk/twext/who/idirectory.py	2014-03-06 04:17:29 UTC (rev 12828)
@@ -460,7 +460,33 @@
         """
 
 
+    def addMembers(members):
+        """
+        Adds the members to this group.
 
+        @param members: The records of the members to add to this group.
+        @type members: An iterable of L{IDirectoryRecord}s.
+        """
+
+
+    def removeMembers(members):
+        """
+        Removes the members from this group.
+
+        @param members: The records of the members to remove from this group.
+        @type members: An iterable of L{IDirectoryRecord}s.
+        """
+
+
+    def setMembers(members):
+        """
+        Replaces the current members with a new set of members.
+
+        @param members: The records comprising the new set of members.
+        @type members: An iterable of L{IDirectoryRecord}s.
+        """
+
+
 class IPlaintextPasswordVerifier(Interface):
     """
     Provides a way to verify a plaintext password as provided by a client.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140305/6f0ce10b/attachment-0001.html>


More information about the calendarserver-changes mailing list