locked
httpmodule event pipeline RRS feed

  • Question

  • User-2088238045 posted

    In my OnBeginRequest method, I am doing a url re-write. If i move through the url, and check to see if modules exist from that url, I want to then see if the user requsting this is authorized to view it. Can I do that check in OnBeginRequest?  I didn't think the user was set up yet. WOuld I have to load the modules from the url first, then authorize the user against those modules?

    Thanks,
    Mick

    Monday, July 23, 2007 10:06 PM

All replies

  • User-2088238045 posted

    To expand, I want to grab the url being requested.
    e.g. /view/section/page.aspx

    I want to then get the view part, and see if the user is authorized to view that view. If they are, then continue to the section. Try and authorize for that section and so on. This way, it would cut down on checks, instead of loading all of them, then authorizing. So my question is can I do that in OnBeginRequest, or should I move it to 
    void app_AuthorizeRequest(object sender, EventArgs e)

    Can I do the context.rewritepath(url) from
    void app_PreRequestHandlerExecute(object sender, EventArgs e) at the end? That way, I can do all the checks and rewrite the path to whatever.

    Thanks in advance,

    Mick
     

    Tuesday, July 24, 2007 12:25 AM