[Pkg-owncloud-commits] [php-sabredav] 05/40: Allowing everyone to read information from the inbox.

David Prévot taffit at moszumanska.debian.org
Sat Sep 5 15:24:06 UTC 2015


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

taffit pushed a commit to tag 3.1.0-alpha2
in repository php-sabredav.

commit a436252a30d44c1e842190e38b93282a0da2eb55
Author: Evert Pot <me at evertpot.com>
Date:   Fri Jul 24 13:24:29 2015 -0400

    Allowing everyone to read information from the inbox.
    
    This is needed for availability to work.
---
 lib/CalDAV/Schedule/Inbox.php             | 12 +------
 tests/Sabre/CalDAV/Schedule/InboxTest.php | 55 +++++++++++++------------------
 2 files changed, 24 insertions(+), 43 deletions(-)

diff --git a/lib/CalDAV/Schedule/Inbox.php b/lib/CalDAV/Schedule/Inbox.php
index 7fa4ec1..c5053e2 100644
--- a/lib/CalDAV/Schedule/Inbox.php
+++ b/lib/CalDAV/Schedule/Inbox.php
@@ -148,7 +148,7 @@ class Inbox extends DAV\Collection implements IInbox {
         return [
             [
                 'privilege' => '{DAV:}read',
-                'principal' => $this->getOwner(),
+                'principal' => '{DAV:}authenticated',
                 'protected' => true,
             ],
             [
@@ -162,16 +162,6 @@ class Inbox extends DAV\Collection implements IInbox {
                 'protected' => true,
             ],
             [
-                'privilege' => '{DAV:}read',
-                'principal' => $this->getOwner() . '/calendar-proxy-read',
-                'protected' => true,
-            ],
-            [
-                'privilege' => '{DAV:}read',
-                'principal' => $this->getOwner() . '/calendar-proxy-write',
-                'protected' => true,
-            ],
-            [
                 'privilege' => '{DAV:}unbind',
                 'principal' => $this->getOwner() . '/calendar-proxy-write',
                 'protected' => true,
diff --git a/tests/Sabre/CalDAV/Schedule/InboxTest.php b/tests/Sabre/CalDAV/Schedule/InboxTest.php
index 73d8feb..43cce7d 100644
--- a/tests/Sabre/CalDAV/Schedule/InboxTest.php
+++ b/tests/Sabre/CalDAV/Schedule/InboxTest.php
@@ -1,6 +1,7 @@
 <?php
 
 namespace Sabre\CalDAV\Schedule;
+
 use Sabre\CalDAV;
 use Sabre\DAV;
 
@@ -13,56 +14,46 @@ class InboxTest extends \PHPUnit_Framework_TestCase {
             'principals/user1'
         );
         $this->assertEquals('inbox', $inbox->getName());
-        $this->assertEquals(array(), $inbox->getChildren());
+        $this->assertEquals([], $inbox->getChildren());
         $this->assertEquals('principals/user1', $inbox->getOwner());
         $this->assertEquals(null, $inbox->getGroup());
 
-        $this->assertEquals(array(
-            array(
+        $this->assertEquals([
+            [
                 'privilege' => '{DAV:}read',
-                'principal' => 'principals/user1',
+                'principal' => '{DAV:}authenticated',
                 'protected' => true,
-            ),
-            array(
+            ],
+            [
                 'privilege' => '{DAV:}write-properties',
                 'principal' => 'principals/user1',
                 'protected' => true,
-            ),
-            array(
+            ],
+            [
                 'privilege' => '{DAV:}unbind',
                 'principal' => 'principals/user1',
                 'protected' => true,
-            ),
-            array(
-                'privilege' => '{DAV:}read',
-                'principal' => 'principals/user1/calendar-proxy-read',
-                'protected' => true,
-            ),
-            array(
-                'privilege' => '{DAV:}read',
-                'principal' => 'principals/user1/calendar-proxy-write',
-                'protected' => true,
-            ),
-            array(
+            ],
+            [
                 'privilege' => '{DAV:}unbind',
                 'principal' => 'principals/user1/calendar-proxy-write',
                 'protected' => true,
-            ),
-            array(
+            ],
+            [
                 'privilege' => '{urn:ietf:params:xml:ns:caldav}schedule-deliver-invite',
                 'principal' => '{DAV:}authenticated',
                 'protected' => true,
-            ),
-            array(
+            ],
+            [
                 'privilege' => '{urn:ietf:params:xml:ns:caldav}schedule-deliver-reply',
                 'principal' => '{DAV:}authenticated',
                 'protected' => true,
-            ),
-        ), $inbox->getACL());
+            ],
+        ], $inbox->getACL());
 
         $ok = false;
         try {
-            $inbox->setACL(array());
+            $inbox->setACL([]);
         } catch (DAV\Exception\MethodNotAllowed $e) {
             $ok = true;
         }
@@ -81,11 +72,11 @@ class InboxTest extends \PHPUnit_Framework_TestCase {
         $r = $inbox->getSupportedPrivilegeSet();
 
         $ok = 0;
-        foreach($r['aggregates'] as $priv) {
+        foreach ($r['aggregates'] as $priv) {
 
             if ($priv['privilege'] == '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-deliver') {
                 $ok++;
-                foreach($priv['aggregates'] as $subpriv) {
+                foreach ($priv['aggregates'] as $subpriv) {
                     if ($subpriv['privilege'] == '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-deliver-invite') {
                         $ok++;
                     }
@@ -175,9 +166,9 @@ class InboxTest extends \PHPUnit_Framework_TestCase {
         $this->assertEquals(
             ['schedule1.ics'],
             $inbox->calendarQuery([
-                'name' => 'VCALENDAR',
-                'comp-filters' => [],
-                'prop-filters' => [],
+                'name'           => 'VCALENDAR',
+                'comp-filters'   => [],
+                'prop-filters'   => [],
                 'is-not-defined' => false
             ])
         );

-- 
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