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 May 10, 2022
1 parent f0f2a07 commit c714c33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/files/lib/Controller/TransferOwnershipController.php
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 Down Expand Up @@ -97,7 +98,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 c714c33

Please sign in to comment.