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 b614af016a
commit fe2d3161f7
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

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