modified authorize function to check for access file