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:
parent
3135d3a7b2
commit
e5bc45c349
1 changed files with 8 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue