#19 Adding Roles to BugTracker.NET (CODE ATTACHED)

open
nobody
None
5
2009-11-05
2007-10-04
Jimmy M
No

i didn't see a way to attach this to any of the existing roles posts - so I made a new one.

Attached is my take on the many roles feature requests seen on the features list.

Some new role-related files, and some updates to editing bugs, users, etc.

Run the sqlupdate.sql script on your bugtracker.net DB (back it up first :) to create/alter the appropriate DB tables.

A summary of features:

1) Admin menu now has roles option. Roles can be added and specific statuses can be selected to apply to those roles.

2) Editing a user a default role can be assigned to that user.

3) User project permissions can also have roles set on a per-project basis. This can be done from the admin's 'edit user' screen, or the project's 'edit user permissions' screen

4) Added 'role' column to user list in admin section.

When creating or editing bugs, only the statuses you have access to (either by default, or inside that project) can be selected. Should a user have created a bug with a status you don't have access to - but it's assigned to you - the option of '[current status]' is selected by default. This allows you to make changes to the bug without having to set it to a status you have access to that may not be appropriate (i.e. a PM assigns a bug to a sales person for more info, but that bug is 'in process' and sales people only have access to the statuses of 'new' and 'on hold' - the sales person can answer the question and give it back to someone without changing status).

The SQL script will also create an 'Admin' role, give it access to all statuses, and assign it to every user. This is so your btnet install does not break because users must be assigned a role. This will give them the same functionality they have now (the ability to assign all statuses) and then you can create alternate roles and assign them to users.

Enjoy :)

Discussion

1 2 > >> (Page 1 of 2)
  • Jimmy M
    Jimmy M
    2007-10-04

    Logged In: YES
    user_id=1905598
    Originator: YES

    File Added: Bugtracker-Roles.zip

     
  • Corey Trager
    Corey Trager
    2007-10-05

    • priority: 5 --> 9
     
  • Corey Trager
    Corey Trager
    2007-10-05

    Logged In: YES
    user_id=645778
    Originator: NO

    Thanks for posting this. Just from your description, its sounds like a lot of work and a major, important change.

    Folks - if anybody else tries these changes out, please post your experience here. Thanks.

     
  • Logged In: NO

    ctrager - did you try it out?

     
  • Jimmy M
    Jimmy M
    2007-10-05

    Logged In: YES
    user_id=1905598
    Originator: YES

    v--- forgot to log in ---V

     
  • Corey Trager
    Corey Trager
    2007-10-05

    Logged In: YES
    user_id=645778
    Originator: NO

    it will be a couple weeks probably before I have a block of time to try it out.

     
  • Jimmy M
    Jimmy M
    2007-10-05

     Code for adding Roles to BugTracker.NET (merge with v2.5.6) (new 10/5)
    
     
    Attachments
  • Jimmy M
    Jimmy M
    2007-10-05

    Logged In: YES
    user_id=1905598
    Originator: YES

    File Added: Bugtracker-Roles.zip

     
  • Jimmy M
    Jimmy M
    2007-10-05

    Logged In: YES
    user_id=1905598
    Originator: YES

    Please download the latest version if you haven't. Had a bug in edit_bug.aspx on new bug creation that didn't save the initial status.

     
  • Logged In: NO

    3 errors found in SQL script make me want to wait until this is officially integrated:

    -- 1. Need to add the DEFAULT(1) with the NOT NULL or better yet change to NULL
    ALTER TABLE project_user_xref ADD pu_default_role int NOT NULL DEFAULT(1)
    GO
    -- 2. ditto
    ALTER TABLE users ADD us_default_role int NOT NULL DEFAULT(1)
    GO
    -- 3. The insert statement for role_status_xref had mutliple bugs. This is what it should be:

    INSERT INTO role_status_xref
    (rs_statusid, rs_roleid)
    SELECT st_id, r_id
    FROM roles, statuses
    GO

    I will post results if/when I get time to play with this.

     
1 2 > >> (Page 1 of 2)