mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 10:10:49 -04:00
fix: give target file all permissions on copy
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
7fd4d811de
commit
0f04a40479
1 changed files with 7 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ use OC\Files\Search\SearchComparison;
|
|||
use OC\Files\Search\SearchQuery;
|
||||
use OC\Files\Storage\Wrapper\Encryption;
|
||||
use OC\SystemConfig;
|
||||
use OCP\Constants;
|
||||
use OCP\DB\Exception;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
|
|
@ -1185,6 +1186,12 @@ class Cache implements ICache {
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue