summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-27 16:16:06 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-27 16:16:06 +0100
commit6973718fb8cb8d5c5c27690675079b2ef574abd1 (patch)
treef696647f8530d84f9b6700b2e5705fd33301b7c2 /apps
parent05bff25cf3611837da86ea68d050d070cc0a4213 (diff)
parenta4900d721f466540987f2770b5cf66aa95164c85 (diff)
downloadnextcloud-server-6973718fb8cb8d5c5c27690675079b2ef574abd1.tar.gz
nextcloud-server-6973718fb8cb8d5c5c27690675079b2ef574abd1.zip
Merge pull request #21940 from owncloud/share2_do_not_returned_removed_group_shares
[Share 2.0] Properly handle user deleted group shares
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/api/share20ocs.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/api/share20ocs.php
index c5e7dcff824..3048eb7cd1a 100644
--- a/apps/files_sharing/api/share20ocs.php
+++ b/apps/files_sharing/api/share20ocs.php
@@ -335,7 +335,9 @@ class Share20OCS {
$formatted = [];
foreach ($shares as $share) {
- $formatted[] = $this->formatShare($share);
+ if ($this->canAccessShare($share)) {
+ $formatted[] = $this->formatShare($share);
+ }
}
return new \OC_OCS_Result($formatted);
@@ -496,6 +498,11 @@ class Share20OCS {
* @return bool
*/
protected function canAccessShare(IShare $share) {
+ // A file with permissions 0 can't be accessed by us. So Don't show it
+ if ($share->getPermissions() === 0) {
+ return false;
+ }
+
// Owner of the file and the sharer of the file can always get share
if ($share->getShareOwner() === $this->currentUser ||
$share->getSharedBy() === $this->currentUser