简体   繁体   中英

Specific page security on web.config

I have the following on my web.config

<location path = "WebPages/Reports">
    <system.web>
        <authorization>
            <deny roles="DeniedRole1, DeniedRole2"/>
            <allow roles="AllowRole1,AllowRole2,AllowRole3"/>
        </authorization>
    </system.web>
</location>
<location path = "WebPages/Reports/SpecificPage.aspx">
    <system.web>
        <authorization>
            <allow roles ="*"/>
        </authorization>
    </system.web>
</location>

Basically what I'm trying to do is for everyone to have access to the SpecificPage.aspx, but for any other page inside the Reports folder it should apply the deny/allow rules. However, this is giving me the following error:

Parser Error Message: Authorization rule names cannot contain the '*' character.

Any help is appreciated!

Try

<location path = "WebPages/Reports/SpecificPage.aspx">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM