System.Web.Security.UrlAuthorizationModule.CheckUrlAccessForPrincipal Method

Determines whether the user has access to the requested file.

Syntax

public static bool CheckUrlAccessForPrincipal (string virtualPath, System.Security.Principal.IPrincipal user, string verb)

Parameters

virtualPath
The virtual path to the file.
user
An System.Security.Principal.IPrincipal object representing the current user.
verb
The HTTP verb used to make the request.

Returns

true if the current user can access the file; otherwise, false.

Remarks

The UrlAuthorizationModule.CheckUrlAccessForPrincipal(string, System.Security.Principal.IPrincipal, string) method checks to see whether the current user is granted access to the requested file in the Web.config file for the application.

If the HTTP verb used to make the request is GET, POST, or HEAD, the UrlAuthorizationModule.CheckUrlAccessForPrincipal(string, System.Security.Principal.IPrincipal, string) method checks for read access to the file. If any other verb is used, the UrlAuthorizationModule.CheckUrlAccessForPrincipal(string, System.Security.Principal.IPrincipal, string) checks for read/write access to the file.

For more information and an example Web.config file, see the System.Web.Security.UrlAuthorizationModule class documentation.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0