If a user enters a URL with a action=editDocument, I want to be able to redirect them to the same URL but with action=openDocument.
I assume that I would use the beforePageLoad event?
How could I prevent them from going to the action=editDocument and redirect them to a action=openDocument url?
The following will redirect back to the same page if the parameter action is “editDocument” (and thereby prevent the user from editing the document):
Update: As Mark points out in his answer, the above answer will not preserve a documentId parameter if included. You can check if the documentId parameter is included and then do a proper redirect using that parameter: