|
|
|
@ -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(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|