Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try adding the following to your <code>&lt;system.webServer&gt; &lt;modules&gt;</code> block:</p> <pre><code>&lt;configuration&gt; &lt;system.webServer&gt; &lt;modules&gt; &lt;remove name="FormsAuthentication" /&gt; &lt;add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" /&gt; &lt;remove name="UrlAuthorization" /&gt; &lt;add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" /&gt; &lt;remove name="DefaultAuthentication" /&gt; &lt;add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" /&gt; &lt;remove name="RoleManager" /&gt; &lt;add name="RoleManager" type="System.Web.Security.RoleManagerModule" /&gt; &lt;/modules&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <p>The <code>RoleManager</code> bit is key, and it's not included in any of the online examples that I could find. Without that, the user's role membership isn't initialized for static content, so role-based authorization will always fail.</p> <p>(Disclaimer: I've pieced this together myself based on my limited understanding of IIS, but it seems to work.)</p> <p><strong>Edit</strong> (in response to your comment): Sorry, I don't know much about how RoleManager depends on other modules. You can view the default IIS configuration by looking at <code>c:\Windows\System32\inetsrv\config\applicationHost.config</code> (at least, that's the past on my Windows Vista machine) to see the order in which modules are loaded (note the use of <a href="http://msdn.microsoft.com/en-us/library/ms690693%28VS.90%29.aspx" rel="nofollow">managedHandler</a> by default to restrict RoleManager to non-static content), and MSDN covers <a href="http://msdn.microsoft.com/en-us/library/system.web.security.rolemanagermodule.aspx" rel="nofollow">RoleManagerModule</a> along with the rest of the modules in the <a href="http://msdn.microsoft.com/en-us/library/kt5ssstk.aspx" rel="nofollow">System.Web.Security</a> namespace, so you could probably find what you need there.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload