Proper way to set permissions for files