fix permissions for files API
Merge pull request #7090 from NARKOZ/api-files-access

fix permissions for files API