FileAuthorizationModule.CheckFileAccessForUser(String, IntPtr, String) 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 CheckFileAccessForUser(System::String ^ virtualPath, IntPtr token, System::String ^ verb);
public static bool CheckFileAccessForUser (string virtualPath, IntPtr token, string verb);
static member CheckFileAccessForUser : string * nativeint * string -> bool
Public Shared Function CheckFileAccessForUser (virtualPath As String, token As IntPtr, verb As String) As Boolean
- virtualPath
- String
The virtual path to the file.
- token
-
IntPtr
nativeint
A Windows access token representing the user.
- verb
- String
The HTTP verb used to make the request.
true
if the current Windows user represented by token
has access to the file using the specified HTTP verb or if the FileAuthorizationModule module is not defined in the application's configuration file; otherwise, false
.
virtualPath
is not in the application directory structure of the Web application.
The file specified by virtualPath
does not exist.
The CheckFileAccessForUser method checks to see whether the current user, represented by a Windows access token, is granted access to the requested file in the file-system access-control lists (ACLs). The virtual path is mapped to the physical file-system path before the check is made.
If the HTTP verb used to make the request is GET
, POST
, or HEAD
, the CheckFileAccessForUser method checks for read access to the file. If any other verb is used, the CheckFileAccessForUser method checks for read/write permission to the file.
Security Note If the FileAuthorizationModule module is not defined in the httpModules
configuration section for the application, the FileAuthorizationModule module always returns true
.
Product | Versions |
---|---|
.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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: