title: web.config authorization: Allow based on method call?
body: <p>I'm attempting to retrofit an intranet-only ASP.NET webapp with some rudimentary security.</p>
  
  <p>I have a database table of authorized users, keyed on their AD ID, and I have a method which reads the AD ID from the Request object and matches it against the table.  I would like to use the web.config "authorization" elements to call this function, something like this:</p>
  
  <pre><code>&lt;location path="/"&gt;
      &lt;system.web&gt;
          &lt;authorization&gt;
              &lt;allow method="checkDatabase()"/&gt;
              &lt;deny users="*"/&gt;
          &lt;/authorization&gt;
      &lt;/system.web&gt;
  &lt;/location&gt;
  </code></pre>
  
  <p>I realize this syntax is invalid, but is there an equivalent that functions in this fashion?</p>