Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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 April 25th, 2006, 12:02 PM
Far Far is offline
Registered User
 
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Bugbase - superuser not there, tried adding

Hi,

I added a role called superuser - I want it to have all the roles available but there is no place to do this. Is there?

Thanks, Far

 
Old April 25th, 2006, 12:59 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Far,

You may be running into the same issue that has been reported for the CMS site: a mismatch between the Membership and Roleproviders.

Here's how to fix it:

1. Open the web.config file and add an applicationName attribute to the roleProvider like this:
Code:
<providers>
  <add
    name="SqlProvider"
    type="System.Web.Security.SqlRoleProvider"
    connectionStringName="BugBase"
    applicationName="/"
  />
</providers>
2. Run the WAT by choosing Website | ASP.NET Configuration from within Visual Web Developer (with the BugBase project open of course)

3. Click the Security tab

4. Make sure the roles are there. If not, create the following roles:

  a) Developer
  b) Tester
  c) Manager
  d) Administrator

5. Next, if necessary, create the user accounts:

  a) Developer
  b) Tester
  c) Manager
  d) Administrator
  e) SuperUser

and assign them to the appropriate roles

6. Run the site and log in with one of your accounts. Things should work as expected.

If you're lazy, you can just create the four roles and the SuperUser account, assign it to those four roles and log in and then manage the rest of the accounts through the BugBase Maintenance section.

Once you're logged in, choose Maintenance | Members. From there you can create new accounts and assign them to existing roles. This section is a nice demo of working with the Role and Membership API's and shows you how to build your own user management tool if you find the WAT to be too limited.

The Maintenance section doesn't allow you to create new roles on-line (there's no point because you would also need to write new functionality that makes use of those roles), but with the code from the Membership section, it shouldn't be too hard to figure out how to create and manage roles programmatically.

Hope this helps,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: The Only One by Limp Bizkit (Track 9 from the album: Results May Vary) What's This?
 
Old April 25th, 2006, 01:17 PM
Far Far is offline
Registered User
 
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

Yes that helped.

I already kinda of did this.

I did not make the change in the web.config. But I had created a user called superuser with all the roles checked off.

What I wanted is a role called "super" which would do all the things that the other roles did so I can assign this role to several users.

Thanks for your help. You are awesome!

-Far

 
Old April 25th, 2006, 01:50 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:What I wanted is a role called "super" which would do all the things that the other roles did so I can assign this role to several users.
Right, I see. That's not possible with the current design of ASP.NET which doesn't support nested roles. Nice enhancement request for ASP.NET 3, though.

You could more or less recreate this functionality your self, by expanding the code and configuration files. For example, when you change this:
Code:
  <location path="Reporting">
    <system.web>
      <authorization>
        <allow roles="Manager" />
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>
  to this:
Code:
  <location path="Reporting">
Code:
    <system.web>
      <authorization>
        <allow roles="Manager, SuperUsers" />
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>
  the group SuperUsers can now access the Management folder as well.

However, you should realize that the web.config file alone is not enough. You also need to change the Web.sitemap file and several pieces of code that makes use of Role checking, like this piece of code from the AddEditBug.aspx page:
Code:
        If User.IsInRole("Developer") _
          OrElse User.IsInRole("Manager") Then
You can see this code checks the roles a user belongs to. You need to add an additional OrElse clause for the SuperUser role.

Hope this helps, and please keep me updated if you want on your progress if you decide to go this route.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Pocket Knife by P.J. Harvey (Track 4 from the album: Uh Huh Her) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Bugbase - cannot login Vishy BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 July 13th, 2008 11:49 AM
BugBase jackandjo BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 February 27th, 2008 01:04 PM
bugbase:cant login kotak BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 12 November 15th, 2007 04:13 AM
Errors connecting to BugBase marcel33 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 9 February 15th, 2007 03:21 AM
BugBase: Adding dynamic themes in Master Page rjd BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 13 November 28th, 2006 06:31 PM





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