Determine if user can access the requested page?

后端 未结 7 1459
小鲜肉
小鲜肉 2021-01-05 10:36

I have an ASP.Net website with multiple roles, each with access to a separate directory (i.e. admin users can access /admin, shoppers can access /shop etc), using a shared l

7条回答
  •  萌比男神i
    2021-01-05 11:34

    UrlAuthorizationModule.CheckUrlAccessForPrincipal()
    

    is what you need to use to test user access to a location (page or folder) ( http://msdn.microsoft.com/en-us/library/system.web.security.urlauthorizationmodule.checkurlaccessforprincipal.aspx )

提交回复
热议问题