add route /doc/id that redirects to /edit or /view according the user rigths