diff options
author | Joas Schilling <coding@schilljs.com> | 2017-03-27 16:06:31 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-04-13 12:58:50 +0200 |
commit | 91e650791de6dbb320e5163f626c754d42e0bc35 (patch) | |
tree | b6860a90d3b22bfd715cd7ba444673ae72bebfc0 /lib/private/Share20/Manager.php | |
parent | 0c2dc3bc8cdca46afc2bc08da4a985610093f2af (diff) | |
download | nextcloud-server-91e650791de6dbb320e5163f626c754d42e0bc35.tar.gz nextcloud-server-91e650791de6dbb320e5163f626c754d42e0bc35.zip |
Return the paths for the users without setting them all up
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Share20/Manager.php')
-rw-r--r-- | lib/private/Share20/Manager.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index f1ce66f008c..91fcb6af8fb 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1191,9 +1191,10 @@ class Manager implements IManager { * * Then the access list will to '/folder1/folder2/fileA' is: * [ - * users => ['user1', 'user2', 'user4'], + * users => ['user1' => ['node_id' => 42, 'node_path' => '/path'], 'user2' => [...]], + * remote => ['user1' => ['node_id' => 42, 'node_path' => '/path'], 'user2' => [...]], * public => bool - * remote => bool + * mail => bool * ] * * This is required for encryption/activity @@ -1206,7 +1207,7 @@ class Manager implements IManager { public function getAccessList(\OCP\Files\Node $path, $recursive = true, $currentAccess = false) { $owner = $path->getOwner()->getUID(); - $al = ['users' => [], 'public' => false, 'remote' => false]; + $al = ['users' => [], 'remote' => [], 'public' => false]; if (!$this->userManager->userExists($owner)) { return $al; } @@ -1222,7 +1223,12 @@ class Manager implements IManager { /** @var Node[] $nodes */ $nodes = []; - $al['users'][] = $owner; + $ownerPath = $path->getPath(); + list(,,,$ownerPath) = explode('/', $ownerPath, 4); + $al['users'][$owner] = [ + 'node_id' => $path->getId(), + 'node_path' => '/' . $ownerPath, + ]; // Collect all the shares while ($path->getPath() !== $userFolder->getPath()) { @@ -1249,8 +1255,6 @@ class Manager implements IManager { } } - $al['users'] = array_unique($al['users']); - return $al; } |