Skip to content
Open
Changes from all commits
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
7 changes: 7 additions & 0 deletions lib/private/Files/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use OC\Files\Search\SearchQuery;
use OC\Files\Storage\Wrapper\Encryption;
use OC\SystemConfig;
use OCP\Constants;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Cache\CacheEntryInsertedEvent;
Expand Down Expand Up @@ -1162,6 +1163,12 @@ public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, str
throw new \RuntimeException('Invalid source cache entry on copyFromCache');
}
$data = $this->cacheEntryToArray($sourceEntry);
// since we are essentially creating a new file, we don't have to obey the source permissions
if ($sourceEntry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE) {
$data['permissions'] = Constants::PERMISSION_ALL;
} else {
$data['permissions'] = Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE;
}

// when moving from an encrypted storage to a non-encrypted storage remove the `encrypted` mark
if ($sourceCache instanceof Cache && $sourceCache->hasEncryptionWrapper() && !$this->hasEncryptionWrapper()) {
Expand Down
Loading