From 5b57bb955b6f5289bf80aac7ade760d76ce033c6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 10 Apr 2017 16:22:12 +0200 Subject: Fix default share provider Signed-off-by: Joas Schilling --- lib/private/Share20/DefaultShareProvider.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 49a756f2a10..b28dc56f852 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -1128,17 +1128,18 @@ class DefaultShareProvider implements IShareProvider { } } else if ($type === \OCP\Share::SHARE_TYPE_LINK) { $link = true; - } else if ($type === self::SHARE_TYPE_USERGROUP) { - if ($currentAccess === true) { - $uid = $row['share_with']; - $users[$uid] = isset($users[$uid]) ? $users[$uid] : []; - $users[$uid][$row['id']] = $row; - } + } else if ($type === self::SHARE_TYPE_USERGROUP && $currentAccess === true) { + $uid = $row['share_with']; + $users[$uid] = isset($users[$uid]) ? $users[$uid] : []; + $users[$uid][$row['id']] = $row; } } $cursor->closeCursor(); $users = array_map([$this, 'filterSharesOfUser'], $users); + if ($currentAccess === true) { + $users = array_filter($users); + } return ['users' => $users, 'public' => $link]; } -- cgit v1.2.3