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 c9af398 commit a343a60
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 @@ -808,6 +808,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 &&
$sendPasswordByTalk === null &&
Expand Down

0 comments on commit a343a60

Please sign in to comment.