Fix OCS API to be able to remove group shares from self as recipient

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2016-10-25 10:18:42 +02:00
parent 3135d3a7b2
commit e5bc45c349
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
1 changed files with 8 additions and 2 deletions

View File

@ -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();
}