[CalendarServer-changes] [4060] CalendarServer/branches/users/sagen/wikiauth-4053/twistedcaldav/ directory/wiki.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Apr 22 09:42:15 PDT 2009
Revision: 4060
http://trac.macosforge.org/projects/calendarserver/changeset/4060
Author: sagen at apple.com
Date: 2009-04-22 09:42:14 -0700 (Wed, 22 Apr 2009)
Log Message:
-----------
Added comments
Modified Paths:
--------------
CalendarServer/branches/users/sagen/wikiauth-4053/twistedcaldav/directory/wiki.py
Modified: CalendarServer/branches/users/sagen/wikiauth-4053/twistedcaldav/directory/wiki.py
===================================================================
--- CalendarServer/branches/users/sagen/wikiauth-4053/twistedcaldav/directory/wiki.py 2009-04-22 16:33:26 UTC (rev 4059)
+++ CalendarServer/branches/users/sagen/wikiauth-4053/twistedcaldav/directory/wiki.py 2009-04-22 16:42:14 UTC (rev 4060)
@@ -129,10 +129,19 @@
@inlineCallbacks
def getWikiACL(resource, request):
+ """
+ Ask the wiki server we're paired with what level of access the authnUser has.
+ Returns an ACL.
+
+ Wiki authentication is a bit tricky because the end-user accessing a group
+ calendar may not actually be enabled for calendaring. Therefore in that
+ situation, the authzUser will have been replaced with the wiki principal
+ in locateChild( ), so that any changes the user makes will have the wiki
+ as the originator. The authnUser will always be the end-user.
+ """
from twistedcaldav.directory.principal import DirectoryPrincipalResource
-
if (not hasattr(resource, "record") or
resource.record.recordType != WikiDirectoryService.recordType_wikis):
returnValue(None)
@@ -164,6 +173,8 @@
log.info("Wiki ACL result: user [%s], wiki [%s], access [%s]" % (userID,
wikiID, access))
+ # The ACL we returns has ACEs for the end-user and the wiki principal
+ # in case authzUser is the wiki principal.
if access == "read":
request.wikiACL = davxml.ACL(
davxml.ACE(
@@ -239,6 +250,7 @@
)
)
+
except Fault, fault:
log.info("Wiki ACL result: user [%s], wiki [%s], FAULT [%s]" % (userID,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090422/cf1b92d5/attachment.html>
More information about the calendarserver-changes
mailing list