Security asp.net C#-在web.config中为子目录设置角色
我使用的是两级文件夹结构。CMS文件夹包含两个文件夹。 1.用户。 2.管理员Security asp.net C#-在web.config中为子目录设置角色,security,Security,我使用的是两级文件夹结构。CMS文件夹包含两个文件夹。 1.用户。 2.管理员 **After login i am not able to access page.After login again redirect to login page. 在main web.config中 在main web.config中,我设置了loginurl并允许所有用户 ---CMS ----User ----Admin Means CMS/{USER}{Admin}.**
**After login i am not able to access page.After login again redirect to login page.
在main web.config中
在main web.config中,我设置了loginurl并允许所有用户
---CMS
----User
----Admin
Means CMS/{USER}{Admin}.**
在用户文件夹web.config中:
设置管理员用户的角色
<system.web>
<compilation debug="true" targetFramework="4.0">
</compilation>
<authentication mode="Forms">
<forms name="HESCMS1.0" loginUrl="~/CMS/User/Login.aspx" timeout="40" slidingExpiration="true" cookieless="UseCookies" protection="All" requireSSL="false" enableCrossAppRedirects="false"/>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
<customErrors mode="Off"></customErrors>
</system.web>
<system.web>
<httpRuntime requestValidationMode="2.0"/>
</system.web>
在管理文件夹web.config中:
设置超级管理员的角色
<system.web>
<authorization>
<allow roles="CMSUserAdmin" />
<deny users="*"/>
</authorization>
</system.web>
<location path="Login.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
这是我在stack中的第一篇文章,所以我没有那么多经验
<system.web>
<authorization>
<allow roles="CMSSuperAdmin"/>
<deny users="*" />
</authorization>
</system.web>
<location path="Login.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>