
<allow> | 433
web.config
Reference
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
You can specify authorization settings for a specific file or directory in your appli-
cation that differs from the defaults configured in the root web.config file for the
application in either of two ways:
• By adding an
<authorization> element to the web.config file of the desired
child directory, as shown in the example.
• By using a
<location> tag in the root web.config file and setting its path
attribute to the desired path, as follows:
<configuration>
<location path="files">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
<system.web>
<!--other configuration settings -->
</system.web>
</configuration>
<allow>
Specifies users, roles, and/or HTTP verbs to be authorized for the application.
Scope
Any
Attributes
users
A comma-delimited list of authorized usernames.
roles
A comma-delimited list of authorized roles (NT groups).
verbs
A comma-delimited list of authorized HTTP verbs (GET, HEAD, POST, or
DEBUG).
Child Elements
None
Example
See the example for the <authorization> element.
Notes
You can use two wildcards to specify special groups of users:
* When used for the value of the
user attribute, allows access for all users. This
is the default configuration setting, as defined in machine.config.
? When used for the value ...