Skip to content

Commit bea70d4

Browse files
authored
Merge pull request #12562 from nextcloud/backport/12544/stable13
[13] Handle permission in update of share better
2 parents f627754 + 7b2a7f6 commit bea70d4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apps/files_sharing/lib/Controller/ShareAPIController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,10 @@ public function updateShare(
695695
throw new OCSNotFoundException($this->l->t('Wrong share ID, share doesn\'t exist'));
696696
}
697697

698+
if ($share->getShareOwner() !== $this->currentUser && $share->getSharedBy() !== $this->currentUser) {
699+
throw new OCSForbiddenException('You are not allowed to edit incomming shares');
700+
}
701+
698702
if ($permissions === null && $password === null && $publicUpload === null && $expireDate === null) {
699703
throw new OCSBadRequestException($this->l->t('Wrong or no update parameter given'));
700704
}

0 commit comments

Comments
 (0)