
Authorization | 205
ASP.NET
Security
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
One of the first things you might do in this example is remove the Everyone group
from the folder, since this group (as the name suggests) allows anyone who can
access the computer to access this file.
Use caution when removing special accounts (such as the SYSTEM
account) from the ACLs for a given resource. Some operating sys-
tem files require the SYSTEM account to have access to them for
the OS to function, so removing those permissions can cause major
problems, up to and including not being able to start the OS.
URL Authorization
URL authorization uses the <allow> or <deny> elements of the <authorization>
configuration element to control access to folders and files within the application,
as we saw in the example on Forms authentication. Access can be allowed or
denied based on username, role, and/or HTTP verb used to request the resource.
Thus, to allow user Marcie to access any resource in the application with any
HTTP verb, but to prevent user Charles from making POST requests, we’d add
the following
<authentication> section to the web.config file at the root of the
application (you can also add an
<authentication> section to a web.config file in a
child directory to override or add to these settings):
<authorization>
<allow verb="GET" users="*" /> ...