Skip to content

Commit

Permalink
Use permissions from parent
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
  • Loading branch information
CarlSchwan committed Oct 7, 2021
1 parent 7b17feb commit 3338b71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/private/Files/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -1017,10 +1017,11 @@ public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, str
throw new \RuntimeException("Invalid source cache entry on copyFromCache");
}
$data = $this->cacheEntryToArray($sourceEntry);
$targetParentEntry = $this->get(dirname($targetPath));
if ($sourceEntry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE) {
$data['permissions'] = Constants::PERMISSION_ALL;
$data['permissions'] = $targetParentEntry->getPermissions();
} else {
$data['permissions'] = Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE;
$data['permissions'] = $targetParentEntry->getPermissions() - Constants::PERMISSION_CREATE;
}
$fileId = $this->put($targetPath, $data);
if ($fileId <= 0) {
Expand Down

0 comments on commit 3338b71

Please sign in to comment.