|
@@ 283-286 (lines=4) @@
|
| 280 |
|
return new \OC\OCS\Result(null, 404, 'could not delete share'); |
| 281 |
|
} |
| 282 |
|
|
| 283 |
|
if (!$this->canAccessShare($share)) { |
| 284 |
|
$share->getNode()->unlock(ILockingProvider::LOCK_SHARED); |
| 285 |
|
return new \OC\OCS\Result(null, 404, $this->l->t('Could not delete share')); |
| 286 |
|
} |
| 287 |
|
|
| 288 |
|
$this->shareManager->deleteShare($share); |
| 289 |
|
|
|
@@ 487-490 (lines=4) @@
|
| 484 |
|
|
| 485 |
|
$share->setSharedWith($shareWith); |
| 486 |
|
$share->setPermissions($permissions); |
| 487 |
|
} else { |
| 488 |
|
$share->getNode()->unlock(ILockingProvider::LOCK_SHARED); |
| 489 |
|
return new \OC\OCS\Result(null, 400, $this->l->t('Unknown share type')); |
| 490 |
|
} |
| 491 |
|
|
| 492 |
|
$share->setShareType($shareType); |
| 493 |
|
$share->setSharedBy($this->currentUser->getUID()); |
|
@@ 700-703 (lines=4) @@
|
| 697 |
|
|
| 698 |
|
$share->getNode()->lock(\OCP\Lock\ILockingProvider::LOCK_SHARED); |
| 699 |
|
|
| 700 |
|
if (!$this->canAccessShare($share)) { |
| 701 |
|
$share->getNode()->unlock(ILockingProvider::LOCK_SHARED); |
| 702 |
|
return new \OC\OCS\Result(null, 404, $this->l->t('Wrong share ID, share doesn\'t exist')); |
| 703 |
|
} |
| 704 |
|
|
| 705 |
|
$permissions = $this->request->getParam('permissions', null); |
| 706 |
|
$password = $this->request->getParam('password', null); |
|
@@ 901-904 (lines=4) @@
|
| 898 |
|
$node->lock(\OCP\Lock\ILockingProvider::LOCK_SHARED); |
| 899 |
|
|
| 900 |
|
// this checks that we are either the owner or recipient |
| 901 |
|
if (!$this->canAccessShare($share)) { |
| 902 |
|
$node->unlock(ILockingProvider::LOCK_SHARED); |
| 903 |
|
return new \OC\OCS\Result(null, 404, $this->l->t('Wrong share ID, share doesn\'t exist')); |
| 904 |
|
} |
| 905 |
|
|
| 906 |
|
// only recipient can accept/reject share |
| 907 |
|
if ($share->getShareOwner() === $this->currentUser->getUID() || |