fix(dav): Use share initiator to get the share node, because the owner might on another server

Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
provokateurin 2026-03-03 15:25:54 +01:00
parent 5e6f099624
commit eb9f88e79c
No known key found for this signature in database
3 changed files with 3 additions and 5 deletions

View file

@ -58,7 +58,6 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, funct
}
$share = $authBackend->getShare();
$owner = $share->getShareOwner();
$isReadable = $share->getPermissions() & \OCP\Constants::PERMISSION_READ;
$fileId = $share->getNodeId();
@ -73,7 +72,7 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, funct
\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
$rootFolder = \OCP\Server::get(\OCP\Files\IRootFolder::class);
$userFolder = $rootFolder->getUserFolder($owner);
$userFolder = $rootFolder->getUserFolder($share->getSharedBy());
$node = $userFolder->getFirstNodeById($fileId);
if (!$node) {
throw new \Sabre\DAV\Exception\NotFound();

View file

@ -85,7 +85,6 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, funct
}
$share = $authBackend->getShare();
$owner = $share->getShareOwner();
$isReadable = $share->getPermissions() & \OCP\Constants::PERMISSION_READ;
$fileId = $share->getNodeId();
@ -113,7 +112,7 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, funct
Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
$rootFolder = \OCP\Server::get(\OCP\Files\IRootFolder::class);
$userFolder = $rootFolder->getUserFolder($owner);
$userFolder = $rootFolder->getUserFolder($share->getSharedBy());
$node = $userFolder->getFirstNodeById($fileId);
if (!$node) {
throw new NotFound();

View file

@ -41,7 +41,7 @@ class PublicLinkCheckPlugin extends ServerPlugin {
}
public function beforeMethod(RequestInterface $request, ResponseInterface $response) {
// verify that the owner didn't have his share permissions revoked
// verify that the initiator didn't have their share permissions revoked
if ($this->fileInfo && !$this->fileInfo->isShareable()) {
throw new NotFound();
}