diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-04-19 15:11:54 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-04-20 10:28:32 +0200 |
commit | ae2db5e60da8037568fae86506ca65182924e90b (patch) | |
tree | 27c0f0828aad35808bcebd1e7e9c3ccbabfcd0b5 /lib/private/Share20 | |
parent | a3569a14524f6f669bc9dc868658794ded12776a (diff) | |
download | nextcloud-server-ae2db5e60da8037568fae86506ca65182924e90b.tar.gz nextcloud-server-ae2db5e60da8037568fae86506ca65182924e90b.zip |
Get proper accesslist for userFolder
If the accesslist is requested for a users root folder we should
properly construct the path
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Share20')
-rw-r--r-- | lib/private/Share20/Manager.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 6e59629153e..3afd38c579f 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1233,7 +1233,7 @@ class Manager implements IManager { //Get node for the owner $userFolder = $this->rootFolder->getUserFolder($owner); - if (!$userFolder->isSubNode($path)) { + if ($path->getId() !== $userFolder->getId() && !$userFolder->isSubNode($path)) { $path = $userFolder->getById($path->getId())[0]; } @@ -1245,7 +1245,12 @@ class Manager implements IManager { if ($currentAccess) { $ownerPath = $path->getPath(); - list(, , , $ownerPath) = explode('/', $ownerPath, 4); + $ownerPath = explode('/', $ownerPath, 4); + if (count($ownerPath) < 4) { + $ownerPath = ''; + } else { + $ownerPath = $ownerPath[3]; + } $al['users'][$owner] = [ 'node_id' => $path->getId(), 'node_path' => '/' . $ownerPath, |