Skip to content

Commit

Permalink
fix for transferring ownership of groupfolders
Browse files Browse the repository at this point in the history
Signed-off-by: Vanessa Pertsch <vanessa.pertsch@nextcloud.com>
  • Loading branch information
vanpertsch committed Apr 26, 2022
1 parent dffbddc commit 8d32238
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/files/lib/Controller/TransferOwnershipController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
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;
Expand All @@ -40,7 +41,6 @@
use OCP\IRequest;
use OCP\IUserManager;
use OCP\Notification\IManager as NotificationManager;

class TransferOwnershipController extends OCSController {

/** @var string */
Expand Down Expand Up @@ -97,7 +97,7 @@ public function transfer(string $recipient, string $path): DataResponse {
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);
}

Expand Down

0 comments on commit 8d32238

Please sign in to comment.