Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-04-15 13:51:03 +0300
committerJulius Härtl <jus@bitgrid.net>2021-06-09 11:32:36 +0300
commit4a2804dae28bf0206d015f2a16db8c35e72687bb (patch)
tree38236b58b2abccfa334a53ba4880edcd4ed913a9 /apps/files_sharing/lib
parent932a385c562481ed6a9df95af9b69fa49f267cb2 (diff)
Drop share if moved to a parent share that does not allow resharing
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Updater.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php
index e035ed51ec8..19ff13d8950 100644
--- a/apps/files_sharing/lib/Updater.php
+++ b/apps/files_sharing/lib/Updater.php
@@ -26,6 +26,7 @@
*/
namespace OCA\Files_Sharing;
+use OCP\Constants;
use OCP\Share\IShare;
class Updater {
@@ -81,6 +82,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);
}