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

View file

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