[CalendarServer-changes] [10591] CalendarServer/branches/users/glyph/unshare-when-access-revoked

source_changes at macosforge.org source_changes at macosforge.org
Mon Jan 28 19:29:19 PST 2013


Revision: 10591
          http://trac.calendarserver.org//changeset/10591
Author:   glyph at apple.com
Date:     2013-01-28 19:29:19 -0800 (Mon, 28 Jan 2013)
Log Message:
-----------
Refactor a little; do principal lookup for permissions directly instead of via resource lookup.

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:17 UTC (rev 10590)
+++ CalendarServer/branches/users/glyph/unshare-when-access-revoked/twistedcaldav/sharing.py	2013-01-29 03:29:19 UTC (rev 10591)
@@ -347,8 +347,8 @@
 
         # Direct shares use underlying privileges of shared collection
         if self._share.direct():
-            original = (yield request.locateResource(self._share.url()))
-            owner = yield original.ownerPrincipal(request)
+            ownerUID = self._share.ownerUID()
+            owner = self.principalForUID(ownerUID)
             if owner.record.recordType == WikiDirectoryService.recordType_wikis:
                 # Access level comes from what the wiki has granted to the
                 # sharee
@@ -362,6 +362,7 @@
                 else:
                     access = None
             else:
+                original = (yield request.locateResource(self._share.url()))
                 result = (yield original.accessControlList(request, *args,
                     **kwargs))
                 returnValue(result)
@@ -1462,3 +1463,7 @@
 
     def shareeUID(self):
         return self._shareeHomeChild.viewerHome().uid()
+
+
+    def ownerUID(self):
+        return self._sharerHomeChild.ownerHome().uid()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130128/71114561/attachment.html>


More information about the calendarserver-changes mailing list