How to enable a disabled project

Topics: Core
Nov 5, 2012 at 10:38 AM

If I log in as the adminstrator of bugnet and go to the project list (administrator -> Projects) I can set all the projects in the system. If I click the name of any project I get redirected to the home page, no matter what project I select.

So the result is that "Admin" cannot edit any project nor reenable any disabled project.

 

Logging in as the administrator of any any project I can edit all projects where I'm the project administrator but still cannot see all the disabled projects.

Am I missing something here or this is just an error on the product?

Coordinator
Nov 5, 2012 at 3:44 PM

If you are a super user you can see all the projects.  If you are a project administrator you should see projects in which you have the project administrator role (or have the edit project permission specifically)

Nov 5, 2012 at 3:58 PM

That's my trouble:

- if I loggin as superuser I CAN see all the project but edit NONE

- if I login as project admin I CAN ONLY see active projects

So questions are

  • how to enable a disabled project?
  • is it correct that superusers cannot edit anything?
Coordinator
Nov 5, 2012 at 4:04 PM
Edited Nov 5, 2012 at 4:05 PM

You should be able to edit all projects as a super user or administrator of the project. There is a check on the edit project page as follows:

 

if (!UserManager.IsSuperUser())
            {
                if (!UserManager.HasPermission(ProjectId, Permission.AdminEditProject.ToString()))
                {
                    Response.Redirect("~/Errors/AccessDenied.aspx");
                }   
            }
Once you get to the edit project page, there is a link at the bottom to enable the project once again. Maybe try to recycle the application , I know we have a pending fix of refreshing cached user roles.
Nov 5, 2012 at 4:59 PM
Edited Nov 5, 2012 at 5:00 PM

Then I have a problem here because my system does not work this way. And this issue has been there for a couple versions now. I upgraded to the latest version last week and I still see the same behaviour.

Any idea on where to look at? At the DB I correctly see the "admin" user being assigned to the "Superusers" role. And all project admins are also ok.

I can create new projects with admin, manage active projects with the corresponding users, ... so all but this seems to be working fine. Again, this is not something new for me, since I've been having this issue for quite a long time. I forgot until last week when I had to reactive some projects.

Not sure if this is important, but this system has been upgraded from older versions, not a new installation.

Thank you for your help

Developer
Nov 5, 2012 at 5:13 PM

See this thread and try running the SQL code

http://bugnet.codeplex.com/discussions/394861

Not sure if it will help but it will make sure that the super user has the correct roles setup.

Nov 5, 2012 at 5:22 PM

Running this query:

SELECT * FROM BugNet_Roles r
INNER JOIN BugNet_UserRoles ur ON ur.RoleId = r.RoleId
INNER JOIN aspnet_Users u ON u.UserId = ur.UserId
WHERE u.LoweredUserName = 'admin'
AND r.RoleId = 1
returns a record for the "admin" user so seems it's ok.

Coordinator
Nov 5, 2012 at 7:00 PM

There certainly could be some issue that happened over the upgrade history. Just to confirm the role name is "Super Users" 

Nov 5, 2012 at 8:17 PM

Confirmed, it's "Super Users"

Coordinator
Nov 5, 2012 at 9:05 PM

The quick fix would be just to edit the project table in the database and set the disabled field to false.

I can't see how this wouldn't work , at least in the latest code but maybe there is something else that we fixed recently.

Nov 6, 2012 at 8:22 AM

I think I've found the problem. Notice all my projects are private, meaning only authenticated users can see anything.

I installed the source version and noticied this code on BasePage.cs -> OnInit:

            //Security check using the following rules:
            //1. Authenticated user
            //2. The project type is private 
            //3. The user is not a project member
            if (User.Identity.IsAuthenticated &&
                myProj.AccessType == Globals.ProjectAccessType.Private &&
                !ProjectManager.IsUserProjectMember(User.Identity.Name, projectId))
            {
                ErrorRedirector.TransferToLoginPage(Page);
            }

In my case, user is authenticated, project is private and the IsUserProjectMember return false for user "Admin". So this is the cause of the issue.

Maybe superusers should ALWAYS be considered members of all projects?

Coordinator
Nov 7, 2012 at 4:39 PM

Yes, you are correct, super users should have access to everything and I would consider this a bug because it was our intention of how it should work.  Will add it to the todo list.

Thanks vmasanas.

Coordinator
Nov 7, 2012 at 4:40 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.