Skip to content

Commit

Permalink
Merge pull request #12544 from nextcloud/fix/better_update_share_hand…
Browse files Browse the repository at this point in the history
…ling

Handle permission in update of share better
  • Loading branch information
rullzer authored Nov 20, 2018
2 parents e73bfd5 + a343a60 commit 1bf742c
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 1bf742c

Please sign in to comment.