Geeks With Blogs
Darren Fieldhouse September 2009 Entries
Checking if a user has access to a URL in ASP.NET
I spent ages this morning trying to find a way to determine if a user has permission to access a page before navigating to it. I knew it was possible, the SiteMapProvider has a property called ‚ÄúSecurityTrimmingEnabled‚ÄĚ that hides pages that the user cannot access. In the end I found a really useful object called UrlAuthorizationModule in the System.Web.Security namespace that has a method called CheckUrlAccessForPrincipal(). Pass in the url and get a Boolean return value indicating whether the resource ......

Posted On Monday, September 14, 2009 8:34 AM

Copyright © DarrenFieldhouse | Powered by: GeeksWithBlogs.net | Join free