aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Controller
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-10-15 11:08:21 +0200
committerprovokateurin <kate@provokateurin.de>2024-11-25 10:27:31 +0100
commitbeea8854cac3544792fc13514b5b194b875b44e6 (patch)
tree25ee303914094f43272377560235183ded17695c /apps/files_sharing/lib/Controller
parentb658ab7a86eb2df5d1af8d1ed9d466d33f6c44f0 (diff)
downloadnextcloud-server-beea8854cac3544792fc13514b5b194b875b44e6.tar.gz
nextcloud-server-beea8854cac3544792fc13514b5b194b875b44e6.zip
feat(files_sharing): Allow users with share permission to manage shares on IShareOwnerlessMount
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/files_sharing/lib/Controller')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 2ef4cb77726..ff20a0acf3c 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -35,6 +35,7 @@ use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\InvalidPathException;
use OCP\Files\IRootFolder;
+use OCP\Files\Mount\IShareOwnerlessMount;
use OCP\Files\Node;
use OCP\Files\NotFoundException;
use OCP\HintException;
@@ -1541,6 +1542,12 @@ class ShareAPIController extends OCSController {
return true;
}
+ $userFolder = $this->rootFolder->getUserFolder($this->userId);
+ $file = $userFolder->getFirstNodeById($share->getNodeId());
+ if ($file?->getMountPoint() instanceof IShareOwnerlessMount && $this->shareProviderResharingRights($this->userId, $share, $file)) {
+ return true;
+ }
+
//! we do NOT support some kind of `admin` in groups.
//! You cannot edit shares shared to a group you're
//! a member of if you're not the share owner or the file owner!
@@ -1576,6 +1583,12 @@ class ShareAPIController extends OCSController {
return true;
}
+ $userFolder = $this->rootFolder->getUserFolder($this->userId);
+ $file = $userFolder->getFirstNodeById($share->getNodeId());
+ if ($file?->getMountPoint() instanceof IShareOwnerlessMount && $this->shareProviderResharingRights($this->userId, $share, $file)) {
+ return true;
+ }
+
return false;
}