diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-11-02 14:57:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-02 14:57:45 +0100 |
commit | ffebc050d0492d7fa651e3c369b75881ca189716 (patch) | |
tree | 882661471a66f6f0c6a6fcd2db7ae032035406bf /apps | |
parent | dada3ffb51ce9d941b15f1e3fdc1ce292acebb69 (diff) | |
parent | ea786a35a63fcc85d8487901eeec1f88b6fda078 (diff) | |
download | nextcloud-server-ffebc050d0492d7fa651e3c369b75881ca189716.tar.gz nextcloud-server-ffebc050d0492d7fa651e3c369b75881ca189716.zip |
Merge pull request #1887 from nextcloud/downstream-26370
Added functions to check etag of elements - integration tests
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 4f80b8fc966..1358663ea2b 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -270,11 +270,17 @@ class ShareAPIController extends OCSController { throw new OCSNotFoundException($this->l->t('could not delete share')); } - if (!$this->canAccessShare($share, false)) { + if (!$this->canAccessShare($share)) { throw new OCSNotFoundException($this->l->t('Could not delete share')); } - $this->shareManager->deleteShare($share); + if ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP && + $share->getShareOwner() !== $this->currentUser && + $share->getSharedBy() !== $this->currentUser) { + $this->shareManager->deleteFromSelf($share, $this->currentUser); + } else { + $this->shareManager->deleteShare($share); + } return new DataResponse(); } |