Fix permission for movable storage root

This commit is contained in:
Robin Appelman 2014-06-16 16:20:40 +02:00
parent 3ed4e5b26b
commit 0532f5c39a
1 changed files with 8 additions and 5 deletions

View File

@ -836,11 +836,10 @@ class View {
return $data; return $data;
} }
$path = Filesystem::normalizePath($this->fakeRoot . '/' . $path); $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path);
/**
* @var \OC\Files\Storage\Storage $storage $mount = Filesystem::getMountManager()->find($path);
* @var string $internalPath $storage = $mount->getStorage();
*/ $internalPath = $mount->getInternalPath($path);
list($storage, $internalPath) = Filesystem::resolvePath($path);
$data = null; $data = null;
if ($storage) { if ($storage) {
$cache = $storage->getCache($internalPath); $cache = $storage->getCache($internalPath);
@ -888,6 +887,10 @@ class View {
return false; return false;
} }
if ($mount instanceof MoveableMount) {
$data['permissions'] |= \OCP\PERMISSION_DELETE | \OCP\PERMISSION_UPDATE;
}
$data = \OC_FileProxy::runPostProxies('getFileInfo', $path, $data); $data = \OC_FileProxy::runPostProxies('getFileInfo', $path, $data);
return new FileInfo($path, $storage, $internalPath, $data); return new FileInfo($path, $storage, $internalPath, $data);