mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
fix: give target file all permissions on copy
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
8417db5df8
commit
7dccf5f257
1 changed files with 7 additions and 0 deletions
|
|
@ -16,6 +16,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;
|
||||
|
|
@ -1224,6 +1225,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