check for correct permissions, not only for file exists