[CalendarServer-changes] [1562] CalendarServer/trunk/twistedcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Wed May 23 13:15:25 PDT 2007
Revision: 1562
http://trac.macosforge.org/projects/calendarserver/changeset/1562
Author: cdaboo at apple.com
Date: 2007-05-23 12:34:32 -0700 (Wed, 23 May 2007)
Log Message:
-----------
Mask out ORGANIZER-less events if the requester is the same as the responder.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/method/report_common.py
CalendarServer/trunk/twistedcaldav/schedule.py
Modified: CalendarServer/trunk/twistedcaldav/method/report_common.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/report_common.py 2007-05-23 19:29:00 UTC (rev 1561)
+++ CalendarServer/trunk/twistedcaldav/method/report_common.py 2007-05-23 19:34:32 UTC (rev 1562)
@@ -263,7 +263,8 @@
_namedPropertiesForResource = deferredGenerator(_namedPropertiesForResource)
-def generateFreeBusyInfo(request, calresource, fbinfo, timerange, matchtotal, excludeuid=None, organizer=None):
+def generateFreeBusyInfo(request, calresource, fbinfo, timerange, matchtotal,
+ excludeuid=None, organizer=None, same_calendar_user=False):
"""
Run a free busy report on the specified calendar collection
accumulating the free busy info for later processing.
@@ -276,6 +277,8 @@
UID from contributing to free-busy.
@param organizer: a C{str} containing the value of the ORGANIZER proeprty in the VFREEBUSY request.
This is used in conjunction with the UID value to process exclusions.
+ @param same_calendar_user: a C{bool} indicating whether the calendar user requesting tyhe free-busy information
+ is the same as the calendar user being targeted.
"""
# First check the privilege on this collection
@@ -342,9 +345,14 @@
# Ignore ones of this UID
if excludeuid:
- # Check that ORGANIZER's match (security requirement) and UIDs match
- if (excludeuid == uid) and ((organizer is None) or (organizer == calendar.getOrganizer())):
- continue
+ # See if we have a UID match
+ if (excludeuid == uid):
+ # Check that ORGANIZER's match (security requirement)
+ if (organizer is None) or (organizer == calendar.getOrganizer()):
+ continue
+ # Check for no ORGANIZER and check by same calendar user
+ elif (calendar.getOrganizer() is None) and same_calendar_user:
+ continue
if filter.match(calendar):
# Check size of results is within limit
Modified: CalendarServer/trunk/twistedcaldav/schedule.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/schedule.py 2007-05-23 19:29:00 UTC (rev 1561)
+++ CalendarServer/trunk/twistedcaldav/schedule.py 2007-05-23 19:34:32 UTC (rev 1562)
@@ -402,6 +402,10 @@
availability = availability.calendar()
report_common.processAvailabilityFreeBusy(availability, fbinfo, timerange)
+ # Check to see if the recipient is the same calendar user as the organizer.
+ # Needed for masked UID stuff.
+ same_calendar_user = oprincipal.principalURL() == principal.principalURL()
+
# Now process free-busy set calendars
matchtotal = 0
for calURL in fbset:
@@ -420,7 +424,8 @@
timerange,
matchtotal,
excludeuid=excludeuid,
- organizer=organizer))
+ organizer=organizer,
+ same_calendar_user=same_calendar_user))
yield matchtotal
matchtotal = matchtotal.getResult()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070523/f1eb8f5b/attachment.html
More information about the calendarserver-changes
mailing list