Okay, now I understand. So you are testing if Bob has access and he
does, despite not allowing him in the web.config?
What is happening is you are not denying all users, you are merely
saying, question whether the user has an account. That is what the deny
statement in question is:
<deny users="?"/>
You can change to
<deny users="*"/>
and then explicitly add mary and todd, as you have. This might help
understand the mechanism a bit:
http://msdn.microsoft.com/en-us/library/wce3kxhd.aspx
I have to test, but I believe ordering is important. you can also
explicitly deny Bob, but that is not very maintainable, unless Bob is
always the only one denied.
Personally, I prefer using roles instead of users.
NOTE: There are a few ways to initiate page security, depending on how
much you need.
1. Web.config
2. Sitemap - if using a menu/breadcrumb (note: does not stop user from
getting to something, necessarily, but hides the location)
With security trimmings on with a sitemap, it will respect the security
settings in web.config, as well (ie, not show user links he does not
have access to). This means, for true security, web.config is the way to
go.
NOTE: You can exclude pages from the mix by setting them up in the
config as exceptions. This is useful when the entire site is secure and
you simply need to exclude the default page and login page from the mix.
NOTE: You can secure subdirectories with their own web.config while
leaving the root open to everyone. This is very useful when you have
some secure pages and not others.
Peace and Grace,
--
Gregory A. Beamer (MVP)
Twitter: @gbworld
Blog:
http://gregorybeamer.spaces.live.com
*******************************************
| Think outside the box! |
*******************************************