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:
parent
54f8d48c62
commit
6dd0b5c768
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
namespace OCA\Files_Sharing;
|
namespace OCA\Files_Sharing;
|
||||||
|
|
||||||
|
use OCP\Constants;
|
||||||
use OCP\Share\IShare;
|
use OCP\Share\IShare;
|
||||||
|
|
||||||
class Updater {
|
class Updater {
|
||||||
|
@ -82,6 +83,10 @@ class Updater {
|
||||||
//Ownership is moved over
|
//Ownership is moved over
|
||||||
foreach ($shares as $share) {
|
foreach ($shares as $share) {
|
||||||
/** @var IShare $share */
|
/** @var IShare $share */
|
||||||
|
if (!($dstMount->getShare()->getPermissions() & Constants::PERMISSION_SHARE)) {
|
||||||
|
$shareManager->deleteShare($share);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$share->setShareOwner($newOwner);
|
$share->setShareOwner($newOwner);
|
||||||
$shareManager->updateShare($share);
|
$shareManager->updateShare($share);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue