Now with permission handling in files. Part of #6