UrlAuthorizationModule::CheckUrlAccessForPrincipal Method
Determines whether the user has access to the requested file.
Assembly: System.Web (in System.Web.dll)
[SecurityPermissionAttribute(SecurityAction::Demand, Unrestricted = true)] public: static bool CheckUrlAccessForPrincipal( String^ virtualPath, IPrincipal^ user, String^ verb )
Parameters
- virtualPath
- Type: System::String
The virtual path to the file.
- user
- Type: System.Security.Principal::IPrincipal
An IPrincipal object representing the current user.
- verb
- Type: System::String
The HTTP verb used to make the request.
| Exception | Condition |
|---|---|
| ArgumentNullException | virtualPath is nullptr. - or - user is nullptr. - or - verb is nullptr. |
| 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 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.