J
James McFarland
I want to use FormsAuthentication and allow access based on role.
I have a /Admin directory on the web app, and want to allow role "admin",
but deny all other users.
/Web.config:
<authorization>
<allow users="*" /> <!-- Allow all users -->
</authorization>
/Admin/Web.config:
<authorization>
<allow roles="admin"/>
<deny users="*"/>
</authorization>
This setup prevents all users from accessing pages in the /Admin folder,
even users whose IPrincipal.IsInRole("admin") implementation returns true.
If I change /Amdin/Web.config to the below, it allows the "(e-mail address removed)"
user in:
<authorization>
<allow users="(e-mail address removed)" roles="admin"/>
<deny users="*"/>
</authorization>
Anyone ever seen this problem or have any idea what I am doing wrong?
All examples I have seen appear to use the <allow roles="admin"/> approach.
Thanks,
-james
I have a /Admin directory on the web app, and want to allow role "admin",
but deny all other users.
/Web.config:
<authorization>
<allow users="*" /> <!-- Allow all users -->
</authorization>
/Admin/Web.config:
<authorization>
<allow roles="admin"/>
<deny users="*"/>
</authorization>
This setup prevents all users from accessing pages in the /Admin folder,
even users whose IPrincipal.IsInRole("admin") implementation returns true.
If I change /Amdin/Web.config to the below, it allows the "(e-mail address removed)"
user in:
<authorization>
<allow users="(e-mail address removed)" roles="admin"/>
<deny users="*"/>
</authorization>
Anyone ever seen this problem or have any idea what I am doing wrong?
All examples I have seen appear to use the <allow roles="admin"/> approach.
Thanks,
-james