simplifying the permissions check for the file viewer
cleaned up all the sentinel checks to make sure they're handled properly