]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add missing share types when getting shares of a file
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Fri, 25 Oct 2019 08:40:11 +0000 (10:40 +0200)
committerDaniel Calviño Sánchez <danxuliu@gmail.com>
Fri, 25 Oct 2019 19:39:49 +0000 (21:39 +0200)
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
apps/files_sharing/lib/Controller/ShareAPIController.php
apps/files_sharing/tests/Controller/ShareAPIControllerTest.php

index 8b5ad12ae52b13e5a0d02d3252707b0e89f9e29f..90d739c5bc12bd538d20827ce8148c77672dc338 100644 (file)
@@ -629,10 +629,14 @@ class ShareAPIController extends OCSController {
                        $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_GROUP, $node, true, -1, 0));
                        $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_LINK, $node, true, -1, 0));
                        $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_EMAIL, $node, true, -1, 0));
+                       $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_CIRCLE, $node, true, -1, 0));
                        $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_ROOM, $node, true, -1, 0));
                        if ($this->shareManager->outgoingServer2ServerSharesAllowed()) {
                                $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_REMOTE, $node, true, -1, 0));
                        }
+                       if ($this->shareManager->outgoingServer2ServerGroupSharesAllowed()) {
+                               $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_REMOTE_GROUP, $node, true, -1, 0));
+                       }
                }
 
                $formatted = $miniFormatted = [];
index 3e0dc29fe95929e8525f39df3bfe37bee9900b61..7c77406e4b5f8bb28da80214d386fc805e1bf6e5 100644 (file)
@@ -1251,8 +1251,10 @@ class ShareAPIControllerTest extends TestCase {
                                                IShare::TYPE_GROUP => [$file1GroupShareOwner],
                                                IShare::TYPE_LINK => [$file1LinkShareOwner],
                                                IShare::TYPE_EMAIL => [$file1EmailShareOwner],
+                                               IShare::TYPE_CIRCLE => [$file1CircleShareOwner],
                                                IShare::TYPE_ROOM => [$file1RoomShareOwner],
                                                IShare::TYPE_REMOTE => [$file1RemoteShareOwner],
+                                               IShare::TYPE_REMOTE_GROUP => [$file1RemoteGroupShareOwner],
                                        ],
                                ],
                                [
@@ -1262,6 +1264,7 @@ class ShareAPIControllerTest extends TestCase {
                                        $file1GroupShareOwnerExpected,
                                        $file1LinkShareOwnerExpected,
                                        $file1EmailShareOwnerExpected,
+                                       $file1CircleShareOwnerExpected,
                                        $file1RoomShareOwnerExpected,
                                ]
                        ],
@@ -1276,20 +1279,25 @@ class ShareAPIControllerTest extends TestCase {
                                                IShare::TYPE_GROUP => [$file1GroupShareOwner],
                                                IShare::TYPE_LINK => [$file1LinkShareOwner],
                                                IShare::TYPE_EMAIL => [$file1EmailShareOwner],
+                                               IShare::TYPE_CIRCLE => [$file1CircleShareOwner],
                                                IShare::TYPE_ROOM => [$file1RoomShareOwner],
                                                IShare::TYPE_REMOTE => [$file1RemoteShareOwner],
+                                               IShare::TYPE_REMOTE_GROUP => [$file1RemoteGroupShareOwner],
                                        ],
                                ],
                                [
                                        IShare::TYPE_REMOTE => true,
+                                       IShare::TYPE_REMOTE_GROUP => true,
                                ],
                                [
                                        $file1UserShareOwnerExpected,
                                        $file1GroupShareOwnerExpected,
                                        $file1LinkShareOwnerExpected,
                                        $file1EmailShareOwnerExpected,
+                                       $file1CircleShareOwnerExpected,
                                        $file1RoomShareOwnerExpected,
                                        $file1RemoteShareOwnerExpected,
+                                       $file1RemoteGroupShareOwnerExpected,
                                ]
                        ],
                ];