[Pkg-owncloud-commits] [php-sabredav] 125/275: support for schedule-calendar-transp-property

David Prévot taffit at moszumanska.debian.org
Thu Sep 25 14:55:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 2078ef4630898b738b3eb814d77ca0f2f7fb0678
Author: Dominik Tobschall <dominik at fruux.com>
Date:   Fri Aug 1 01:00:29 2014 +0200

    support for schedule-calendar-transp-property
---
 lib/CalDAV/Schedule/Plugin.php                     |  9 +++++++++
 .../Sabre/CalDAV/Schedule/FreeBusyRequestTest.php  | 23 +++++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/lib/CalDAV/Schedule/Plugin.php b/lib/CalDAV/Schedule/Plugin.php
index fb938c3..8163f37 100644
--- a/lib/CalDAV/Schedule/Plugin.php
+++ b/lib/CalDAV/Schedule/Plugin.php
@@ -19,6 +19,7 @@ use
     Sabre\DAVACL,
     Sabre\CalDAV\ICalendar,
     Sabre\CalDAV\ICalendarObject,
+    Sabre\CalDAV\Property\ScheduleCalendarTransp,
     Sabre\DAV\Exception\NotFound,
     Sabre\DAV\Exception\Forbidden,
     Sabre\DAV\Exception\BadRequest,
@@ -817,6 +818,14 @@ class Plugin extends ServerPlugin {
             if (!$node instanceof ICalendar) {
                 continue;
             }
+
+            $sct = $caldavNS . 'schedule-calendar-transp';
+            $props = $node->getProperties([$sct]);
+
+            if (isset($props[$sct]) && $props[$sct] == ScheduleCalendarTransp::TRANSPARENT) {
+                continue;
+            }
+
             $aclPlugin->checkPrivileges($homeSet . $node->getName() ,$caldavNS . 'read-free-busy');
 
             // Getting the list of object uris within the time-range
diff --git a/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php b/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
index c021fec..27ad783 100644
--- a/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
+++ b/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
@@ -6,7 +6,8 @@ use
     Sabre\DAV,
     Sabre\DAVACL,
     Sabre\HTTP,
-    Sabre\CalDAV;
+    Sabre\CalDAV,
+    Sabre\CalDAV\Property\ScheduleCalendarTransp;
 
 class FreeBusyRequestTest extends \PHPUnit_Framework_TestCase {
 
@@ -24,6 +25,12 @@ class FreeBusyRequestTest extends \PHPUnit_Framework_TestCase {
                 'id'           => 1,
                 'uri'          => 'calendar1',
             ),
+            array(
+                'principaluri' => 'principals/user2',
+                'id'           => 2,
+                'uri'          => 'calendar2',
+                '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-calendar-transp' => ScheduleCalendarTransp::TRANSPARENT,
+            ),
         );
         $calendarobjects = array(
             1 => array( '1.ics' => array(
@@ -35,6 +42,16 @@ DURATION:PT1H
 END:VEVENT
 END:VCALENDAR',
                 'calendarid' => 1,
+            )),
+            2 => array( '2.ics' => array(
+                'uri' => '2.ics',
+                'calendardata' => 'BEGIN:VCALENDAR
+BEGIN:VEVENT
+DTSTART:20110101T080000
+DURATION:PT1H
+END:VEVENT
+END:VCALENDAR',
+                'calendarid' => 2,
             ))
 
         );
@@ -289,6 +306,10 @@ ICS;
             );
         }
 
+        $this->assertTrue(
+            strpos($this->response->body, 'FREEBUSY;FBTYPE=BUSY:20110101T080000Z/20110101T090000Z')==false,
+            'The response body did contain free busy info from a transparent calendar.'
+        );
 
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list