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:
authorblizzz <blizzz@arthur-schiwon.de>2021-06-16 16:26:12 +0300
committerGitHub <noreply@github.com>2021-06-16 16:26:12 +0300
commit818fc95b0399b07bb41c02494292a77700b9b35a (patch)
tree5348f036d6a9b1fd2c578674f1bc0670450920c6 /apps/files_sharing/lib
parent7917f4cf763a3f35f81f500b5f5b5135cd136518 (diff)
parent964fd27666192beb7929342f10ae27cef3455d8b (diff)
Merge pull request #26571 from nextcloud/bugfix/noid/existing-link-no-reshare
Only allow removing existing shares that would not be allowed due to reshare restrictions
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Updater.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php
index e035ed51ec8..9ce114f495d 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,7 +82,12 @@ 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);
+ $share->setPermissions($share->getPermissions() & $dstMount->getShare()->getPermissions());
$shareManager->updateShare($share);
}
}