diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-19 21:27:07 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-04-13 12:58:49 +0200 |
commit | 88299ec27c209a432f925f19970e581f46fc54cd (patch) | |
tree | 20039a2717e0084ff2d569b3b4ddbe61a2dad849 /lib/private/Share20/Manager.php | |
parent | 7dcc98eb202c089a2966004ffb988166f3c4e3d7 (diff) | |
download | nextcloud-server-88299ec27c209a432f925f19970e581f46fc54cd.tar.gz nextcloud-server-88299ec27c209a432f925f19970e581f46fc54cd.zip |
Added to public interface
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Share20/Manager.php')
-rw-r--r-- | lib/private/Share20/Manager.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index ce0444a76ba..d93883e95d4 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1196,17 +1196,21 @@ class Manager implements IManager { * remote => bool * ] * - * This is required for encryption/activities + * This is required for encryption/activity * * @param \OCP\Files\Node $path + * @param bool $recursive Should we check all parent folders as well * @return array */ - public function getAccessList(\OCP\Files\Node $path) { + public function getAccessList(\OCP\Files\Node $path, $recursive = true) { $owner = $path->getOwner()->getUID(); //Get node for the owner $userFolder = $this->rootFolder->getUserFolder($owner); - $path = $userFolder->getById($path->getId())[0]; + + if (!$userFolder->isSubNode($path)) { + $path = $userFolder->getById($path->getId())[0]; + } $providers = $this->factory->getAllProviders(); @@ -1214,10 +1218,13 @@ class Manager implements IManager { $shares = []; // Collect all the shares - while ($path !== $userFolder) { + while ($path->getPath() !== $userFolder->getPath()) { foreach ($providers as $provider) { $shares = array_merge($shares, $provider->getSharesByPath($path)); } + if (!$recursive) { + break; + } $path = $path->getParent(); } |