开发者

ASP.NET How to determine if authenticated user can access a page or directory?

开发者 https://www.devze.com 2023-01-22 01:13 出处:网络
I need to check if an authenticated user is authorized to access a directory. I have done th开发者_如何学JAVAis before with a base class library method, I just cannot remember what class it\'s part

I need to check if an authenticated user is authorized to access a directory.

I have done th开发者_如何学JAVAis before with a base class library method, I just cannot remember what class it's part of or what it's name was. I think the method was a static method and the class may have had the word Utility in it's name, but I just can't remember or find it on the net. BUT I KNOW I HAVE USED IT! The method definition was something like:

bool SomeTypeWithTheWordUtilityInTheNamePossibly.VerifyUserIsAuthorized(Principal user, string virtualPath)

I'm not using a roles provider in this application and I'm not planning to.


FOUND IT! Thanks to this.

UrlAuthorizationModule.CheckUrlAccessForPrincipal

0

精彩评论

暂无评论...
验证码 换一张
取 消