Added function to check if a path is accessible to the user