[CalendarServer-changes] [10595] CalendarServer/branches/users/glyph/unshare-when-access-revoked
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jan 28 19:29:24 PST 2013
Revision: 10595
http://trac.calendarserver.org//changeset/10595
Author: glyph at apple.com
Date: 2013-01-28 19:29:24 -0800 (Mon, 28 Jan 2013)
Log Message:
-----------
remove pluggability for external access, now that tests use patching to satisfy this dependency
Modified Paths:
--------------
CalendarServer/branches/users/glyph/unshare-when-access-revoked/twistedcaldav/sharing.py
Property Changed:
----------------
CalendarServer/branches/users/glyph/unshare-when-access-revoked/
Modified: CalendarServer/branches/users/glyph/unshare-when-access-revoked/twistedcaldav/sharing.py
===================================================================
--- CalendarServer/branches/users/glyph/unshare-when-access-revoked/twistedcaldav/sharing.py 2013-01-29 03:29:22 UTC (rev 10594)
+++ CalendarServer/branches/users/glyph/unshare-when-access-revoked/twistedcaldav/sharing.py 2013-01-29 03:29:24 UTC (rev 10595)
@@ -312,14 +312,11 @@
@inlineCallbacks
- def _checkAccessControl(self, externalAccessMethod=None):
+ def _checkAccessControl(self):
"""
Check the shared access mode of this resource, potentially consulting
an external access method if necessary.
- @param externalAccessMethod: see C{wikiAccessMethod} in
- L{SharedCollectionMixin.shareeAccessControlList}
-
@return: a L{Deferred} firing a L{bytes} or L{None}, with one of the
potential values: C{"own"}, which means that the home is the owner
of the collection and it is not shared; C{"read-only"}, meaning
@@ -331,8 +328,6 @@
access control mechanism has dictate the home should no longer have
any access at all.
"""
- if externalAccessMethod is None:
- externalAccessMethod = getWikiAccess
if self._share.direct():
ownerUID = self._share.ownerUID()
owner = self.principalForUID(ownerUID)
@@ -342,7 +337,7 @@
sharee = self.principalForUID(self._share.shareeUID())
userID = sharee.record.guid
wikiID = owner.record.shortNames[0]
- access = (yield externalAccessMethod(userID, wikiID))
+ access = (yield getWikiAccess(userID, wikiID))
if access == "read":
returnValue("read-only")
elif access in ("write", "admin"):
@@ -377,22 +372,15 @@
L{twext.web2.dav.idav.IDAVResource.accessControlList}, plus
keyword-only arguments.
- @param wikiAccessMethod: (keyword-only) A callable argument used for
- checking external access controls. By default, L{getWikiAccess};
- must be signature-compatible with that method.
-
@return: the appropriate WebDAV ACL for the sharee
@rtype: L{davxml.ACL}
"""
assert self._isShareeCollection, "Only call this for a sharee collection"
- wikiAccessMethod = kwargs.get("wikiAccessMethod", getWikiAccess)
-
sharee = self.principalForUID(self._share.shareeUID())
+ access = yield self._checkAccessControl()
- access = yield self._checkAccessControl(wikiAccessMethod)
-
if access == "original":
original = (yield request.locateResource(self._share.url()))
result = (yield original.accessControlList(request, *args,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130128/4c942e2d/attachment-0001.html>
More information about the calendarserver-changes
mailing list