]> 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:00:21 +0000 (19:00 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/files_sharing/lib/Updater.php

index 2c9ccd1029415ea04e6d3b52491a438f26fe6758..7ca4f005b661a0f210220e9a51de3f74dbc7cc5b 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);
                }