AuthorizationRule Class
Represents a rule in the authorization section of a configuration file.
Syntax
class AuthorizationRule : CollectionElement
Methods
This class contains no methods.
Properties
The following table lists the properties exposed by the AuthorizationRule
class.
Name | Description |
---|---|
AccessType |
A read/write sint32 enumeration that specifies whether access to a URL resource is granted based on the combination of values specified by the Roles , Users , and Verbs properties. The possible values are listed later in the Remarks section. Note: At run time, the authorization module iterates through AuthorizationRule elements until it finds the first rule that fits a particular user. It then grants or denies access to a URL resource depending on the value of the AccessType property. |
Roles |
A required unique read/write string value that contains a comma-delimited list of roles for which access to a URL resource is granted or denied. A key property. Note: There must be at least one value in either the Users property or the Roles property, or both. |
Users |
A required unique read/write string value that contains a comma-delimited list of users for whom access to a URL resource is granted or denied. The default is "*". A key property. Note: There must be at least one value in either the Users property or the Roles property, or both. |
Verbs |
A required unique read/write string value that contains a comma-delimited list of HTTP transmission methods for which access to a URL resource is granted or denied. A key property. |
Subclasses
This class contains no subclasses.
Remarks
Instances of this class are contained in the Authorization
property of the AuthorizationSection class.
The following table lists the possible values for the AccessType
property.
Value | Keyword | Description |
---|---|---|
0 | Allow |
Grants access to a URL resource for the combination of values you specify in the Roles , Users , and Verbs properties. |
1 | Deny |
Denies access to a URL resource for the combination of values you specify in the Roles , Users , and Verbs properties. |
Inheritance Hierarchy
AuthorizationRule
Requirements
Type | Description |
---|---|
Client | - IIS 7.0 on Windows Vista - IIS 7.5 on Windows 7 - IIS 8.0 on Windows 8 - IIS 10.0 on Windows 10 |
Server | - IIS 7.0 on Windows Server 2008 - IIS 7.5 on Windows Server 2008 R2 - IIS 8.0 on Windows Server 2012 - IIS 8.5 on Windows Server 2012 R2 - IIS 10.0 on Windows Server 2016 |
Product | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
MOF file | WebAdministration.mof |
See Also
System.Web.Configuration.AuthorizationRule CollectionElement Class