Drop share if moved to a parent share that does not allow resharing

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2021-04-15 12:51:03 +02:00
parent 54f8d48c62
commit 6dd0b5c768
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 5 additions and 0 deletions

View 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);
}