Skip to content
Snippets Groups Projects
Commit 41d23541 authored by Robin Appelman's avatar Robin Appelman
Browse files

Save the permissions in the filecache if it's not saved yet

parent 3239d109
No related branches found
No related tags found
No related merge requests found
......@@ -861,6 +861,10 @@ class View {
}
if ($data and isset($data['fileid'])) {
if ($data['permissions'] === 0) {
$data['permissions'] = $storage->getPermissions($data['path']);
$cache->update($data['fileid'], array('permissions' => $data['permissions']));
}
if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') {
//add the sizes of other mount points to the folder
$extOnly = ($includeMountPoints === 'ext');
......@@ -917,21 +921,17 @@ class View {
}
$folderId = $cache->getId($internalPath);
/**
* @var \OC\Files\FileInfo[] $files
*/
$files = array();
$contents = $cache->getFolderContents($internalPath, $folderId); //TODO: mimetype_filter
foreach ($contents as $content) {
$files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content);
if ($content['permissions'] === 0) {
$content['permissions'] = $storage->getPermissions($content['path']);
$cache->update($content['fileid'], array('permissions' => $content['permissions']));
}
$ids = array();
foreach ($files as $i => $file) {
$files[$i]['type'] = $file['mimetype'] === 'httpd/unix-directory' ? 'dir' : 'file';
$ids[] = $file['fileid'];
if (!isset($permissions[$file['fileid']])) {
$permissions[$file['fileid']] = $storage->getPermissions($file['path']);
}
$files[$i]['permissions'] = $permissions[$file['fileid']];
$files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content);
}
//add a folder for any mountpoint in this directory and add the sizes of other mountpoints to the folders
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment