Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //NOVA VERZE 14
- public function updateShare(
- string $id,
- int $permissions = null,
- string $password = null,
- string $sendPasswordByTalk = null,
- string $publicUpload = null,
- string $expireDate = null,
- string $note = null,
- string $label = null,
- string $hideDownload = null
- ): DataResponse {
- try {
- $share = $this->getShareById($id);
- } catch (ShareNotFound $e) {
- throw new OCSNotFoundException($this->l->t('Wrong share ID, share doesn\'t exist'));
- }
- $this->lock($share->getNode());
- if (!$this->canAccessShare($share, false)) {
- 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 incoming shares');
- }
- if ($permissions === null &&
- $password === null &&
- $sendPasswordByTalk === null &&
- $publicUpload === null &&
- $expireDate === null &&
- $note === null &&
- $label === null &&
- $hideDownload === null
- ) {
- throw new OCSBadRequestException($this->l->t('Wrong or no update parameter given'));
- }
- if($note !== null) {
- $share->setNote($note);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement