]> source.dussan.org Git - nextcloud-server.git/commitdiff
Handle permission in update of share better 12561/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Tue, 20 Nov 2018 18:36:17 +0000 (19:36 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Tue, 20 Nov 2018 18:36:17 +0000 (19:36 +0100)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/files_sharing/lib/Controller/ShareAPIController.php

index 308e7bbb7429a4d4d24160745c07130aee791ea2..1354c90a9f6841bac1b3bfc373af1c0f5360f57c 100644 (file)
@@ -773,6 +773,10 @@ class ShareAPIController extends OCSController {
                        throw new OCSNotFoundException($this->l->t('Wrong share ID, share doesn\'t exist'));
                }
 
+               if ($share->getShareOwner() !== $this->currentUser && $share->getSharedBy() !== $this->currentUser) {
+                       throw new OCSForbiddenException('You are not allowed to edit incomming shares');
+               }
+
                if ($permissions === null && $password === null && $sendPasswordByTalk === null && $publicUpload === null && $expireDate === null && $note === null) {
                        throw new OCSBadRequestException($this->l->t('Wrong or no update parameter given'));
                }