Skip to content

Commit 24144aa

Browse files
committed
fix: allow moving from of non-resharable to other share if the user has delete permissions
Signed-off-by: Robin Appelman <[email protected]>
1 parent 4283f47 commit 24144aa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apps/dav/lib/Connector/Sabre/SharesPlugin.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use OC\Share20\Exception\BackendError;
1111
use OCA\DAV\Connector\Sabre\Exception\Forbidden;
1212
use OCA\DAV\Connector\Sabre\Node as DavNode;
13+
use OCA\Files_Sharing\SharedStorage;
1314
use OCP\Files\Folder;
1415
use OCP\Files\Node;
1516
use OCP\Files\NotFoundException;
@@ -262,6 +263,14 @@ public function validateMoveOrCopy(string $source, string $target): bool {
262263
return true;
263264
}
264265
}
266+
267+
// if the share recipient is allow to delete from the share, they are allowed to move the file out of the share
268+
// the user moving the file out of the share to their home storage would give them share permissions and allow moving into the share
269+
//
270+
// since the 2-step move is allowed, we also allow both steps at once
271+
if ($sourceNode->isDeletable()) {
272+
return true;
273+
}
265274
}
266275

267276
throw new Forbidden('You cannot move a non-shareable node into a share');

0 commit comments

Comments
 (0)