summaryrefslogtreecommitdiffstats
path: root/lib/private/Share20
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-01-04 08:59:43 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-04-13 12:58:50 +0200
commit12afd7d1d5bc2a85d04815964bf7fb37e77466d6 (patch)
tree11cd311669ab0b2895e3d471bcf974e3f287e31d /lib/private/Share20
parent2cbac3357ba445a3a4cd073e119efb871ea0f719 (diff)
downloadnextcloud-server-12afd7d1d5bc2a85d04815964bf7fb37e77466d6.tar.gz
nextcloud-server-12afd7d1d5bc2a85d04815964bf7fb37e77466d6.zip
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 <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Share20')
-rw-r--r--lib/private/Share20/DefaultShareProvider.php2
-rw-r--r--lib/private/Share20/Manager.php14
2 files changed, 12 insertions, 4 deletions
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']);