Skip to content

Commit 3338b71

Browse files
committed
Use permissions from parent
Signed-off-by: Carl Schwan <[email protected]>
1 parent 7b17feb commit 3338b71

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/private/Files/Cache/Cache.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,10 +1017,11 @@ public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, str
10171017
throw new \RuntimeException("Invalid source cache entry on copyFromCache");
10181018
}
10191019
$data = $this->cacheEntryToArray($sourceEntry);
1020+
$targetParentEntry = $this->get(dirname($targetPath));
10201021
if ($sourceEntry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE) {
1021-
$data['permissions'] = Constants::PERMISSION_ALL;
1022+
$data['permissions'] = $targetParentEntry->getPermissions();
10221023
} else {
1023-
$data['permissions'] = Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE;
1024+
$data['permissions'] = $targetParentEntry->getPermissions() - Constants::PERMISSION_CREATE;
10241025
}
10251026
$fileId = $this->put($targetPath, $data);
10261027
if ($fileId <= 0) {

0 commit comments

Comments
 (0)