How can admin NOT create projects?

Topics: General, Installing BugNET
Sep 8, 2012 at 4:04 PM

I just installed the latest version of bugnet and the default admin user appears to be only a "user" and unable to create projects.  I am unable to create any project and don't have any extra "menu items" on the page?

 

What gives?

Developer
Sep 8, 2012 at 8:51 PM

Something must have happened during the install as I was able to download the latest version, install from scratch and the admin user was a "super user" which allows for full access.

If there were no errors present when the installer ran and you have access to the database to run SQL queries you can run this query and it will setup the Admin user as the "Super Role".

IF NOT EXISTS (
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)
BEGIN
	INSERT INTO BugNet_UserRoles (UserId, RoleId)
	SELECT TOP 1 UserId, 1
	FROM aspnet_Users u
	WHERE u.LoweredUserName = 'admin'
END

 If you do not have access to the database or do not know how to run queries against it you may have to delete/recreate the database and try it again. 

Sep 9, 2012 at 1:55 AM


I seem to have no default data in the database...at least not in the _Roles or _UserRoles tables (which is the outcome below) so the select for the insert returns nothing...

During the setup I did get a few "unable to complete transactions on the create (saying items were already there), but in the end it said it completed successfully.

I'll take a look at the script to create the db....or maybe just reinstall it again. I just seem to be missing some default data.

Msg 547, Level 16, State 0, Line 8

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_BugNet_UserRoles_BugNet_Roles". The conflict occurred in database "BugNet", table "dbo.BugNet_Roles", column 'RoleId'.

The statement has been terminated.

Thanks for dropping a line, I appreciate it!

----- Original Message -----
From: [email removed]
To: [email removed]
Sent: Saturday, September 08, 2012 4:51 PM
Subject: Re: How can admin NOT create projects? [bugnet:394861]

From: wrhighfield

Something must have happened during the install as I was able to download the latest version, install from scratch and the admin user was a "super user" which allows for full access.

If there were no errors present when the installer ran and you have access to the database to run SQL queries you can run this query and it will setup the Admin user as the "Super Role".

IF NOT EXISTS (
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)
BEGIN
	INSERT INTO BugNet_UserRoles (UserId, RoleId)
	SELECT TOP 1 UserId, 1
	FROM aspnet_Users u
	WHERE u.LoweredUserName = 'admin'
END

If you do not have access to the database or do not know how to run queries against it you may have to delete/recreate the database and try it again.

Sep 9, 2012 at 2:35 AM

I guess the second time (install) is the charm? Works now.
Thanks!!
----- Original Message -----
From: [email removed]
To: [email removed]
Sent: Saturday, September 08, 2012 4:51 PM
Subject: Re: How can admin NOT create projects? [bugnet:394861]

From: wrhighfield

Something must have happened during the install as I was able to download the latest version, install from scratch and the admin user was a "super user" which allows for full access.

If there were no errors present when the installer ran and you have access to the database to run SQL queries you can run this query and it will setup the Admin user as the "Super Role".

IF NOT EXISTS (
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)
BEGIN
	INSERT INTO BugNet_UserRoles (UserId, RoleId)
	SELECT TOP 1 UserId, 1
	FROM aspnet_Users u
	WHERE u.LoweredUserName = 'admin'
END

If you do not have access to the database or do not know how to run queries against it you may have to delete/recreate the database and try it again.