Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 18th, 2004, 12:34 AM
Authorized User
 
Join Date: Apr 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default GenericPrincipal and web.config

Hi again.

I have created an Identity with the GenericPrincipal class (associated to the HttpContext.Current.User) to set an user and the roles he belongs to in an application in the global.asax AuthenticationRequest Event. The question is, Can I establish in the web.config file, using the <location> element or even in the <authorization> element those roles defined in my custom Identity to restrict the access to files and folders of the application or do I have to use the Method IsInRole("role") in all the files?

Thanks in advance.

Just reading we'll reach our goals.
__________________
Just reading we\'ll reach our goals.
 
Old June 20th, 2004, 09:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

In the <authorization> element, you can deny roles, as such:

<deny roles="..comma separated list.." />

By establishing the object in the AuthenticationRequest element, I'm not sure if the deny list restricts the roles specified in the HttpContext.Current.User...

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
web.config dpkbahuguna ASP.NET 3.5 Basics 2 August 26th, 2008 09:41 AM
web.config vs. app.config darlo Visual Studio 2005 11 August 20th, 2008 07:23 AM
web.config rrkano .NET Framework 2.0 1 June 23rd, 2008 02:50 PM
Web Config SteveP55419 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 3rd, 2007 04:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.