Skip to content

Commit

Permalink
Merge pull request #12562 from nextcloud/backport/12544/stable13
Browse files Browse the repository at this point in the history
[13] Handle permission in update of share better
  • Loading branch information
rullzer authored Nov 21, 2018
2 parents f627754 + 7b2a7f6 commit bea70d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,10 @@ public function updateShare(
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 && $publicUpload === null && $expireDate === null) {
throw new OCSBadRequestException($this->l->t('Wrong or no update parameter given'));
}
Expand Down

0 comments on commit bea70d4

Please sign in to comment.