How can I create a module to allow only admins to access the website?
<p>Sometimes I need to block access on a website, but I don't want to block access for administrators so they should be able to see the website and for that I guess I need to make a module.</p>

<p>How can I make a module like that?</p>

<p>This is the code I have. I just don't know where I should place it.</p>

<pre><code>var user = Membership.GetUser() as User;

if (user == null || (user != null &amp;&amp; !user.IsAdministrator))
{
    // Block
}
</code></pre>
