diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-07-12 14:55:50 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-21 15:02:18 +0200 |
commit | a93f2a648b2694dcebc3dffd9ca391c1303ce381 (patch) | |
tree | 17540bc009d2f4362bd17439e671b3174a20afa1 /apps/files_sharing | |
parent | cce12f0ca3e2b2b158ffa43450b862053291b8d0 (diff) | |
download | nextcloud-server-a93f2a648b2694dcebc3dffd9ca391c1303ce381.tar.gz nextcloud-server-a93f2a648b2694dcebc3dffd9ca391c1303ce381.zip |
allow to add a personal note to a share
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index d30d5a05a22..816ecde9c40 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -698,17 +698,21 @@ class ShareAPIController extends OCSController { * @param string $password * @param string $publicUpload * @param string $expireDate + * @param string $note * @return DataResponse - * @throws OCSNotFoundException + * @throws LockedException + * @throws NotFoundException * @throws OCSBadRequestException * @throws OCSForbiddenException + * @throws OCSNotFoundException */ public function updateShare( string $id, int $permissions = null, string $password = null, string $publicUpload = null, - string $expireDate = null + string $expireDate = null, + string $note = null ): DataResponse { try { $share = $this->getShareById($id); @@ -722,10 +726,14 @@ class ShareAPIController extends OCSController { throw new OCSNotFoundException($this->l->t('Wrong share ID, share doesn\'t exist')); } - if ($permissions === null && $password === null && $publicUpload === null && $expireDate === null) { + if ($permissions === null && $password === null && $publicUpload === null && $expireDate === null && $note === null) { throw new OCSBadRequestException($this->l->t('Wrong or no update parameter given')); } + if($note !== null) { + $share->setNote($note); + } + /* * expirationdate, password and publicUpload only make sense for link shares */ |