Skip to content

Commit

Permalink
Handle permission in update of share better
Browse files Browse the repository at this point in the history
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Nov 20, 2018
1 parent d268a97 commit 7b2a7f6
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 7b2a7f6

Please sign in to comment.