UrlAuthorizationModule.CheckUrlAccessForPrincipal Method
Definition
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
Parameters
- 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.
Returns
true
if the current user can access the file; otherwise, false
.
Exceptions
virtualPath
is outside of the application root path.
Remarks
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.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기