akkudoktoreos.server.server.fix_data_directories_permissions

akkudoktoreos.server.server.fix_data_directories_permissions(run_as_user: str | None = None) None

Ensure correct ownership for data directories.

This function recursively updates the owner and group of the data directories and all of its subdirectories and files so that they belong to the given user.

The function may require root privileges to change file ownership. It logs an error message if a path ownership can not be updated.

Parameters:

run_as_user (Optional[str]) – The user who should own the data directories and files. Defaults to current one.