Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
use the existing info from the share root to get source storage and path
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Aug 29, 2018
commit ca6072bc8041fa1ccad963e9862fcc5a5c20013c
5 changes: 3 additions & 2 deletions apps/files_sharing/lib/SharedStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ private function init() {
$this->initialized = true;
try {
Filesystem::initMountPoints($this->superShare->getShareOwner());
$sourcePath = $this->ownerView->getPath($this->superShare->getNodeId());
list($this->nonMaskedStorage, $this->rootPath) = $this->ownerView->resolvePath($sourcePath);
$this->rootPath = $this->getSourceRootInfo()->getPath();
$mounts = $this->ownerView->getMountByNumericId($this->getSourceRootInfo()->getStorageId());
$this->nonMaskedStorage = $mounts[0]->getStorage();
$this->storage = new PermissionsMask([
'storage' => $this->nonMaskedStorage,
'mask' => $this->superShare->getPermissions()
Expand Down
11 changes: 11 additions & 0 deletions lib/private/Files/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,17 @@ public function getMount($path) {
return Filesystem::getMountManager()->find($this->getAbsolutePath($path));
}

/**
* @param int $id
* @return IMountPoint[]
*/
public function getMountByNumericId($id) {
$mounts = Filesystem::getMountByNumericId($id);
return array_values(array_filter($mounts, function(IMountPoint $mountPoint) {
return $this->getRelativePath($mountPoint->getMountPoint()) || $mountPoint->getInternalPath($this->fakeRoot);
}));
}

/**
* resolve a path to a storage and internal path
*
Expand Down