]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix for transferring ownership of groupfolders 32329/head
authorVanessa Pertsch <vanessa.pertsch@nextcloud.com>
Tue, 26 Apr 2022 07:10:36 +0000 (09:10 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Wed, 11 May 2022 06:45:34 +0000 (06:45 +0000)
Signed-off-by: Vanessa Pertsch <vanessa.pertsch@nextcloud.com>
apps/files/lib/Controller/TransferOwnershipController.php

index fb1a8b33dc128db9ac14e0207d3f8d543b2fd964..5abd65444bf99d3155c5080e66250af598cb78d3 100644 (file)
@@ -30,6 +30,7 @@ namespace OCA\Files\Controller;
 use OCA\Files\BackgroundJob\TransferOwnership;
 use OCA\Files\Db\TransferOwnership as TransferOwnershipEntity;
 use OCA\Files\Db\TransferOwnershipMapper;
+use OCP\Files\IHomeStorage;
 use OCP\AppFramework\Db\DoesNotExistException;
 use OCP\AppFramework\Http;
 use OCP\AppFramework\Http\DataResponse;
@@ -97,7 +98,7 @@ class TransferOwnershipController extends OCSController {
                        return new DataResponse([], Http::STATUS_BAD_REQUEST);
                }
 
-               if ($node->getOwner()->getUID() !== $this->userId) {
+               if ($node->getOwner()->getUID() !== $this->userId || !$node->getStorage()->instanceOfStorage(IHomeStorage::class)) {
                        return new DataResponse([], Http::STATUS_FORBIDDEN);
                }