Merge pull request #3447 from nextcloud/getmetadata-permissions-mask

also apply permissions mask in getMetaData
This commit is contained in:
Roeland Jago Douma 2017-02-15 20:22:08 +01:00 committed by GitHub
commit 17c07e5caf
2 changed files with 10 additions and 1 deletions

View File

@ -491,7 +491,7 @@ class Scanner extends BasicEmitter implements IScanner {
} else {
$lastPath = null;
while (($path = $this->cache->getIncomplete()) !== false && $path !== $lastPath) {
$this->runBackgroundScanJob(function() use ($path) {
$this->runBackgroundScanJob(function () use ($path) {
$this->scan($path, self::SCAN_RECURSIVE_INCOMPLETE, self::REUSE_ETAG | self::REUSE_SIZE);
}, $path);
// FIXME: this won't proceed with the next item, needs revamping of getIncomplete()

View File

@ -138,4 +138,13 @@ class PermissionsMask extends Wrapper {
$sourceCache = parent::getCache($path, $storage);
return new CachePermissionsMask($sourceCache, $this->mask);
}
public function getMetaData($path) {
$data = parent::getMetaData($path);
if ($data && isset($data['permissions'])) {
$data['permissions'] = $data['permissions'] & $this->mask;
}
return $data;
}
}