[CalendarServer-changes] [11904] CalendarServer/branches/users/sagen/groupcacher/twext/who/delegates .py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:15:56 PDT 2014
Revision: 11904
http://trac.calendarserver.org//changeset/11904
Author: sagen at apple.com
Date: 2013-11-07 11:20:46 -0800 (Thu, 07 Nov 2013)
Log Message:
-----------
Docstrings
Modified Paths:
--------------
CalendarServer/branches/users/sagen/groupcacher/twext/who/delegates.py
Modified: CalendarServer/branches/users/sagen/groupcacher/twext/who/delegates.py
===================================================================
--- CalendarServer/branches/users/sagen/groupcacher/twext/who/delegates.py 2013-11-07 19:10:12 UTC (rev 11903)
+++ CalendarServer/branches/users/sagen/groupcacher/twext/who/delegates.py 2013-11-07 19:20:46 UTC (rev 11904)
@@ -29,7 +29,15 @@
@inlineCallbacks
def addDelegate(txn, delegator, delegate, readWrite):
"""
- Args are records
+ Adds "delegate" as a delegate of "delegator". The type of access is
+ specified by the "readWrite" parameter.
+
+ @param delegator: the delegator's directory record
+ @type delegator: L{IDirectoryRecord}
+ @param delegate: the delegate's directory record
+ @type delegate: L{IDirectoryRecord}
+ @param readWrite: if True, read and write access is granted; read-only
+ access otherwise
"""
if delegate.recordType == RecordType.group:
# find the groupID
@@ -42,7 +50,15 @@
@inlineCallbacks
def removeDelegate(txn, delegator, delegate, readWrite):
"""
- Args are records
+ Removes "delegate" as a delegate of "delegator". The type of access is
+ specified by the "readWrite" parameter.
+
+ @param delegator: the delegator's directory record
+ @type delegator: L{IDirectoryRecord}
+ @param delegate: the delegate's directory record
+ @type delegate: L{IDirectoryRecord}
+ @param readWrite: if True, read and write access is revoked; read-only
+ access otherwise
"""
if delegate.recordType == RecordType.group:
# find the groupID
@@ -56,7 +72,15 @@
@inlineCallbacks
def delegatesOf(txn, delegator, readWrite):
"""
- Args are records
+ Return the records of the delegates of "delegator". The type of access
+ is specified by the "readWrite" parameter.
+
+ @param delegator: the delegator's directory record
+ @type delegator: L{IDirectoryRecord}
+ @param readWrite: if True, read and write access delegates are returned;
+ read-only access otherwise
+ @return: the set of directory records
+ @rtype: a Deferred which fires a set of L{IDirectoryRecord}
"""
records = []
directory = delegator.service
@@ -72,7 +96,15 @@
@inlineCallbacks
def delegatedTo(txn, delegate, readWrite):
"""
- Args are records
+ Return the records of those who have delegated to "delegate". The type of
+ access is specified by the "readWrite" parameter.
+
+ @param delegate: the delegate's directory record
+ @type delegate: L{IDirectoryRecord}
+ @param readWrite: if True, read and write access delegators are returned;
+ read-only access otherwise
+ @return: the set of directory records
+ @rtype: a Deferred which fires a set of L{IDirectoryRecord}
"""
records = []
directory = delegate.service
@@ -86,4 +118,8 @@
def allGroupDelegates(txn):
+ """
+ @return: the GUIDs of all groups which are currently delegated to
+ @rtype: a Deferred which fires with a set() of GUID strings
+ """
return txn.allGroupDelegates()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/fe0ec2b0/attachment.html>
More information about the calendarserver-changes
mailing list