diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-04-15 13:51:03 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-06-29 20:01:10 +0300 |
commit | 86ef3539ad9d4a684b22044ac1835c0de1ead06b (patch) | |
tree | c1e61b005ad3e0654acf2ff96bc3ccbd014682b9 /apps | |
parent | a5c9193bc906151556cb0d10a6b3a167cb58b9dc (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')
-rw-r--r-- | apps/files_sharing/lib/Updater.php | 5 |
1 files changed, 5 insertions, 0 deletions
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); } |