diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-25 10:18:42 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-02 08:49:58 +0100 |
commit | e5bc45c34934ea16af622d5cafe5c4946f688c20 (patch) | |
tree | 7bf3d6408157ceaf86f9980d6c35af17523f030d /apps | |
parent | 3135d3a7b2be8eb73704ee3b1d75a8c8a81209f0 (diff) | |
download | nextcloud-server-e5bc45c34934ea16af622d5cafe5c4946f688c20.tar.gz nextcloud-server-e5bc45c34934ea16af622d5cafe5c4946f688c20.zip |
Fix OCS API to be able to remove group shares from self as recipient
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
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 ad9ac6c0851..0d62ba48ed5 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -245,11 +245,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(); } |