diff options
Diffstat (limited to 'apps/files/lib/Controller')
-rw-r--r-- | apps/files/lib/Controller/TransferOwnershipController.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files/lib/Controller/TransferOwnershipController.php b/apps/files/lib/Controller/TransferOwnershipController.php index 639e73187ca..0b33e12e88f 100644 --- a/apps/files/lib/Controller/TransferOwnershipController.php +++ b/apps/files/lib/Controller/TransferOwnershipController.php @@ -96,6 +96,10 @@ class TransferOwnershipController extends OCSController { return new DataResponse([], Http::STATUS_BAD_REQUEST); } + if ($node->getOwner()->getUID() !== $this->userId) { + return new DataResponse([], Http::STATUS_FORBIDDEN); + } + $transferOwnership = new TransferOwnershipEntity(); $transferOwnership->setSourceUser($this->userId); $transferOwnership->setTargetUser($recipient); |