Compare commits

...

3 Commits

Author SHA1 Message Date
Julius Härtl 140dd424ae
Only allow removing existing shares that would not be allowed due to reshare restrictions
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-05-27 13:41:01 +02:00
Julius Härtl 26b4cde016
When changing the share owner, downgrade permissions where needed
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-05-27 13:39:15 +02:00
Julius Härtl 6dd0b5c768
Drop share if moved to a parent share that does not allow resharing
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-05-27 13:39:15 +02:00
4 changed files with 10 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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,7 +83,12 @@ 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);
$share->setPermissions($share->getPermissions() & $dstMount->getShare()->getPermissions());
$shareManager->updateShare($share); $shareManager->updateShare($share);
} }
} }

View File

@ -131,7 +131,7 @@
:open.sync="open" :open.sync="open"
@close="onMenuClose"> @close="onMenuClose">
<template v-if="share"> <template v-if="share">
<template v-if="share.canEdit"> <template v-if="share.canEdit && canReshare">
<!-- Custom Label --> <!-- Custom Label -->
<ActionInput <ActionInput
ref="label" ref="label"