Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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 December 14th, 2008, 02:42 PM
Authorized User
 
Join Date: Dec 2008
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Roles and Site map etc.

I want to allow access to a page, menu item or chunk of code by whether the user is authenticated/registered. For code like this: this.User.IsInRole("Administrators") how would I do it for registered users?

And this code from the web.sitemap the same question:
<
siteMapNodetitle="$Resources: SiteMap, Admin"url="~/Admin/Default.aspx"roles="Administrators,Editors,Contributors">

One last thing: I chnaged the Sitemap by adding a node and received this message: The resource object with classname 'SiteMap' and key 'Account' was not found.

Was not found where? Is there another place I need to change something?

Thanks everyone, for some reason this stuff is eluding me,

Shawn
 
Old December 14th, 2008, 03:58 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

1. To allow access to a page for authenticated users, test the value of User.Identity.IsAuthenticated.

2. The default sitemap provider in ASP.NET does not implement security trimming based on authentication, but only on authorization (i.e., filtering based on roles). But there are other ways to handle this scenario. One way would be to enclose part of your navigation in a LoginView control. Another would be to place all registered users in a default role.

3. As for the other part, you need to read the chapter on Globalization and Localization to understand how to work with globalization resources.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
 
Old December 14th, 2008, 04:27 PM
Authorized User
 
Join Date: Dec 2008
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Lee Dumond View Post
1. To allow access to a page for authenticated users, test the value of User.Identity.IsAuthenticated.

2. The default sitemap provider in ASP.NET does not implement security trimming based on authentication, but only on authorization (i.e., filtering based on roles). But there are other ways to handle this scenario. One way would be to enclose part of your navigation in a LoginView control. Another would be to place all registered users in a default role.

3. As for the other part, you need to read the chapter on Globalization and Localization to understand how to work with globalization resources.
Thanks! I just figured out 2 & 3. 1 I hadn't figured out # 1 yet. Thanks a bunch.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Site Map mallikalapati ASP.NET 2.0 Basics 1 February 9th, 2008 02:56 PM
Passing more than one querystring in the site map kaushikpulpa ASP.NET 2.0 Basics 1 April 20th, 2007 08:08 AM
Site map security trimming. weisma BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 December 25th, 2006 11:57 PM
display hierarchical site map using repeaters wlin ASP.NET 2.0 Basics 1 August 31st, 2006 11:18 AM





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