UrlAuthorizationModule.CheckUrlAccessForPrincipal Method

Determines whether the user has access to the requested file.

Namespace: System.Web.Security
Assembly: System.Web (in system.web.dll)

No code example is currently available or this language may not be supported.
public static boolean CheckUrlAccessForPrincipal (
	String virtualPath, 
	IPrincipal user, 
	String verb
)
public static function CheckUrlAccessForPrincipal (
	virtualPath : String, 
	user : IPrincipal, 
	verb : String
) : boolean
Not applicable.

Parameters

virtualPath

The virtual path to the file.

user

An IPrincipal object representing the current user.

verb

The HTTP verb used to make the request.

Return Value

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

Exception typeCondition

ArgumentNullException

virtualPath is a null reference (Nothing in Visual Basic).

- or -

user is a null reference (Nothing in Visual Basic).

- or -

verb is a null reference (Nothing in Visual Basic).

ArgumentException

virtualPath is outside of the application root path.

The CheckUrlAccessForPrincipal 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 CheckUrlAccessForPrincipal method checks for read access to the file. If any other verb is used, the CheckUrlAccessForPrincipal checks for read/write access to the file.

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

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: