I decorated my base controller with several action filters. They work great.
One of these filters customizes the request β it does things like setting up a culture based on a domain, etc.
I also have several actions that require authorization using the Authorize attribute.
My problem is that when a user tries to request a page that they donβt have access to, the authorization filter launches and redirects them to the page, telling them that they cannot compete with the page.
The problem is that action filters never run, so culture and other query data are never set. This actually leads to misuse of the language in the view and other data that will be missing.
I know that authorization filters are started first, but my question is this: how can I create this in such a way that I can guarantee that certain methods will always be executed until the view returns, regardless of authorization.
Hope this makes sense.
source share