Same question as on: Content Folder Permissions on create but for Kirby 3? How can we change this setting? I didn’t found it in the documentation.
I only want to change the permission of the created files/directories from 644 to 664.
Same question as on: Content Folder Permissions on create but for Kirby 3? How can we change this setting? I didn’t found it in the documentation.
I only want to change the permission of the created files/directories from 644 to 664.
I can’t find any file/folder permission setting anywhere in the source code. You could use a hook to chmod()
the folder/file upon creation.
thanks for your response I used the following hooks. Based on https://getkirby.com/docs/reference/plugins/extensions/hooks
function updateDirectoryPermissions()
{
$path = __DIR__ . '/../../content';
exec("find " . $path . " -type d -exec chmod 0664 {} +");
exec("find " . $path . " -type f -exec chmod 0664 {} +");
}
// site/config/config.php
return [
'hooks' => [
'page.create:after' => function ($page) {
updateDirectoryPermissions();
},
'page.update:after' => function ($newPage, $oldPage) {
updateDirectoryPermissions();
}
]
Maybe there’s also a way to set this generally on your server instead of using the hook. You could contact your provider to find out.