UrlAuthorizationModule.CheckUrlAccessForPrincipal Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines whether the user has access to the requested file.
public:
static bool CheckUrlAccessForPrincipal(System::String ^ virtualPath, System::Security::Principal::IPrincipal ^ user, System::String ^ verb);
public static bool CheckUrlAccessForPrincipal (string virtualPath, System.Security.Principal.IPrincipal user, string verb);
static member CheckUrlAccessForPrincipal : string * System.Security.Principal.IPrincipal * string -> bool
Public Shared Function CheckUrlAccessForPrincipal (virtualPath As String, user As IPrincipal, verb As String) As Boolean
- virtualPath
- String
The virtual path to the file.
- user
- IPrincipal
An IPrincipal object representing the current user.
- verb
- String
The HTTP verb used to make the request.
true
if the current user can access the file; otherwise, false
.
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.
Producto | Versiones |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Comentarios de .NET
.NET es un proyecto de código abierto. Seleccione un vínculo para proporcionar comentarios: