only read permissions once

This commit is contained in:
Robin Appelman 2014-10-20 16:53:06 +02:00
parent 9bbfeada6b
commit 9df18ffe75
1 changed files with 3 additions and 2 deletions

View File

@ -80,7 +80,8 @@ class Scanner extends BasicEmitter {
* @return array an array of metadata of the file * @return array an array of metadata of the file
*/ */
public function getData($path) { public function getData($path) {
if (!$this->storage->isReadable($path)) { $permissions = $this->storage->getPermissions($path);
if (!$permissions & \OCP\PERMISSION_READ) {
//cant read, nothing we can do //cant read, nothing we can do
\OCP\Util::writeLog('OC\Files\Cache\Scanner', "!!! Path '$path' is not accessible or present !!!", \OCP\Util::DEBUG); \OCP\Util::writeLog('OC\Files\Cache\Scanner', "!!! Path '$path' is not accessible or present !!!", \OCP\Util::DEBUG);
return null; return null;
@ -95,7 +96,7 @@ class Scanner extends BasicEmitter {
} }
$data['etag'] = $this->storage->getETag($path); $data['etag'] = $this->storage->getETag($path);
$data['storage_mtime'] = $data['mtime']; $data['storage_mtime'] = $data['mtime'];
$data['permissions'] = $this->storage->getPermissions($path); $data['permissions'] = $permissions;
return $data; return $data;
} }