]> source.dussan.org Git - nextcloud-server.git/commitdiff
Drop share if moved to a parent share that does not allow resharing
authorJulius Härtl <jus@bitgrid.net>
Thu, 15 Apr 2021 10:51:03 +0000 (12:51 +0200)
committerJulius Härtl <jus@bitgrid.net>
Tue, 29 Jun 2021 17:01:10 +0000 (19:01 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/files_sharing/lib/Updater.php

index 9b5173b489ce52b47f8988c0f72da5b551b20bf8..5542a0d7c4593ba6def543c1258d7c73d264409e 100644 (file)
@@ -27,6 +27,7 @@
 
 namespace OCA\Files_Sharing;
 
+use OCP\Constants;
 use OCP\Share\IShare;
 
 class Updater {
@@ -82,6 +83,10 @@ class Updater {
                //Ownership is moved over
                foreach ($shares as $share) {
                        /** @var IShare $share */
+                       if (!($dstMount->getShare()->getPermissions() & Constants::PERMISSION_SHARE)) {
+                               $shareManager->deleteShare($share);
+                               continue;
+                       }
                        $share->setShareOwner($newOwner);
                        $shareManager->updateShare($share);
                }