From 12afd7d1d5bc2a85d04815964bf7fb37e77466d6 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 4 Jan 2017 08:59:43 +0100 Subject: Add mail element to access list * Each provider just returns what they have so adding an element won't require changing everything * Added tests Signed-off-by: Roeland Jago Douma --- lib/private/Share20/DefaultShareProvider.php | 2 +- lib/private/Share20/Manager.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'lib/private/Share20') diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 93e8cfc9d77..b8f46a1f4d6 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -1138,6 +1138,6 @@ class DefaultShareProvider implements IShareProvider { return $count > 0; }); - return ['users' => array_keys($users), 'public' => $link, 'remote' => false]; + return ['users' => array_keys($users), 'public' => $link]; } } diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 096d05fbec3..f1ce66f008c 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1236,9 +1236,17 @@ class Manager implements IManager { foreach ($providers as $provider) { $tmp = $provider->getAccessList($nodes, $currentAccess); - $al['users'] = array_merge($al['users'], $tmp['users']); - $al['public'] = $al['public'] || $tmp['public']; - $al['remote'] = $al['remote'] || $tmp['remote']; + foreach ($tmp as $k => $v) { + if (isset($al[$k])) { + if (is_array($al[$k])) { + $al[$k] = array_merge($al[$k], $v); + } else { + $al[$k] = $al[$k] || $v; + } + } else { + $al[$k] = $v; + } + } } $al['users'] = array_unique($al['users']); -- cgit v1.2.3