From 86ef3539ad9d4a684b22044ac1835c0de1ead06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 15 Apr 2021 12:51:03 +0200 Subject: Drop share if moved to a parent share that does not allow resharing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files_sharing/lib/Updater.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apps/files_sharing/lib') diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php index 9b5173b489c..5542a0d7c45 100644 --- a/apps/files_sharing/lib/Updater.php +++ b/apps/files_sharing/lib/Updater.php @@ -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); } -- cgit v1.2.3