diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-06-19 17:44:20 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-05 12:43:57 +0200 |
commit | 6a0552224de21e137c3cfa63c589c2b3f65a0987 (patch) | |
tree | 1bbab15cbcf13090a08a6c19e9651bc7df49a365 /lib/private/Share20 | |
parent | d805959e819e64ccf47dfa55fca96b222dedfa9a (diff) | |
download | nextcloud-server-6a0552224de21e137c3cfa63c589c2b3f65a0987.tar.gz nextcloud-server-6a0552224de21e137c3cfa63c589c2b3f65a0987.zip |
getDeletedSharedWith method
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib/private/Share20')
-rw-r--r-- | lib/private/Share20/Manager.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index c0827f13732..5116351a6bc 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1132,6 +1132,25 @@ class Manager implements IManager { /** * @inheritdoc */ + public function getDeletedSharedWith($userId, $shareType, $node = null, $limit = 50, $offset = 0) { + $shares = $this->getSharedWith($userId, $shareType, $node, $limit, $offset); + + // Only get deleted shares + $shares = array_filter($shares, function(IShare $share) { + return $share->getPermissions() === 0; + }); + + // Only get shares where the owner still exists + $shares = array_filter($shares, function (IShare $share) { + return $this->userManager->userExists($share->getShareOwner()); + }); + + return $shares; + } + + /** + * @inheritdoc + */ public function getShareById($id, $recipient = null) { if ($id === null) { throw new ShareNotFound(); |