better indexing of files for permissions #1079