Any updates?
Hello and thanks for adding this feature,
I tested the new patch on Drupal 10.2.5 and Php 8.2.7. The access logic did not worked as expected. The code below have to be changed:
$is_owner = (bool) $account->id() == $file->getOwnerId();
to
$is_owner = $account->id() == $file->getOwnerId();
bool cast have a problem i think. Overall the patch worked after that. I am also adding the revised patch ( add_permission_for_own_files-r1-240426.patch → ).
Best regards,
-Koray
This probem also related to https://www.drupal.org/project/purge_file/issues/3443498 🐛 File_replace does not purge file public urls in a varnish+nginx caching system Needs review .
The patch file added.
kyilmaz80 → created an issue. See original summary → .
Sorry for the wrong patch. I am uploading the correct one.
The attached patch can solve this issue.
kyilmaz80 → created an issue.
I also have this issue. Here is how I solved it:
The files' permission generated by the function file_put_contents() comes from the PHP process. If the php process runs as root, the generated file is also. When running the drush command as root, the generated files' owner will be root. So, running the drush command as a non-root user solves the issue.