Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationNegative RoleIds and RoleID varchar(50)Negative RoleIds and RoleID varchar(50)
Previous
 
Next
New Post
5/31/2008 4:55 AM
 

Hope this is the right forum for this question:

I was unable to add new roles. On checking, I saw the RoleID has been changed from the original RoleID int to RoleID varchar(50). presumably this was done after install by DNN core a module I have installed. This throws an error on inserting a new role as the PK RoleID cannot be NULL and the AddRole sproc assumes an auto generated int for RoleID.

I then noticed that negative RoleIDs are used for All Users and one or two other automated roles. This means referential integrity contstraints for RoleID and apparent FKs is not possible.

Question: What is going on here? How do I solve the problem of not being able to add roles? Is this the way DNN was designed (or not designed:-) or has this negative number thing been bolted on afterwards by a add-in module?

 
New Post
5/31/2008 12:17 PM
 

First question for you Neil.... What version of DNN are we talking about here so I know where to look? Also to make sure I'm looking at the correct table you're talking about the Roles table and not the UserRoles table correct? What modules have you installed lately? A DNN Project module (one that's available from the DNN site) would never have passed the Release process if it arbitrarily changed the type for a core table.

I do believe All Users (which isn't really a role) does return a -1 when but as far as the other default Roles on a single portal install (Registered Users and Subscribers) they should be RoleID 1 and 2 respectively and Administrators RoleID=0.

I guess my last question, and I can see why you may not have tried this yet in case it made things worse, is have you tried setting the RoleID back to an int in your database?

 
New Post
5/31/2008 1:48 PM
 

Mike Horton wrote

First question for you Neil.... What version of DNN are we talking about here so I know where to look?

DNN 4.8.2

Also to make sure I'm looking at the correct table you're talking about the Roles table and not the UserRoles table correct?

Yes. dbo.Roles. Although on looking further I see dbo.UserRoles has also been changed. They both have RoleId nvarchar(50) columns.

What modules have you installed lately?

I keep the zips in one place so it is easiest to give you the directory listing:


05-30-08  10:56AM               349264 10411_DNNMenu_QuickInstallationGuide.zip
05-30-08  10:56AM                99612 10554_0_Google+Analytics+Documentation_entrepriseVersion.zip
05-30-08  10:56AM               149585 10554_0_PHD-GoogleAnalytics-Complete-V1_EntepriseVersion.zip
05-30-08  10:56AM                49850 10554_0_PhdGoogleStats-V1-PA_EntrepriseVersion.zip
05-30-08  10:56AM               172449 4330_OverandOutImagesSRC3.2.zip
05-30-08  10:56AM                51542 5128_0_DataSprings_FlashImageRotator_Module_3.2.zip
05-30-08  10:56AM                13922 8824_0_SVS.GoogleAnalytics_PA_v4.6.2.zip
05-30-08  10:57AM                45466 9186_0_AjaxModuleWrapper_1_5_0_PA.zip
05-30-08  10:57AM                 2020 9186_0_AjaxModuleWrapperLicense.zip
05-30-08  10:57AM               123146 OOImages.zip
05-30-08  10:57AM                20099 OverandOutImages-DNN4.x.PA.zip
05-30-08  10:57AM                 1509 TheDNN.Menu.License.zip
05-06-08  03:45PM              1823071 XMod51_DNN45.zip

A DNN Project module (one that's available from the DNN site) would never have passed the Release process if it arbitrarily changed the type for a core table.

Pleased to hear that:-) I would have felt very nervous otherwise.

I do believe All Users (which isn't really a role) does return a -1 when but as far as the other default Roles on a single portal install (Registered Users and Subscribers) they should be RoleID 1 and 2 respectively and Administrators RoleID=0.

But surely -1 doesn't go into a RoleId FK column? That would mean referential integrity isn't possible to enforce for RoleId FKs leaving them open to insert, delete and update errors.

In fact on looking at a newly installed database with no modules added, I see that Roles is referencing UserRoles correctly, but no relationship is established beteen Roles and the 3 ...Permission tables. These ...Permission tables all contain various negative RoleIds (-1, and -2) so that is why the relationships will have been broken.

I guess my last question, and I can see why you may not have tried this yet in case it made things worse, is have you tried setting the RoleID back to an int in your database?

Doing it on when I get some time. Maybe I will see what breaks then as well. I will report back.

Neil

 
New Post
5/31/2008 2:35 PM
 

The only thing I can suggest with the modules you've installed is to, and I know this is a pain, open any sqldataprovider file they have and do a search on Roles to see if you can find which one changed the tables.

I just took a closer look at the TabsPermission table (I guessing that's one of the ones you were referencing). If you look at the ones with a -2 as a RoleID and cross-reference them to the Tabs table you'll notice that the ones with a -2 for a RoleID are all Host pages. If a page or module is set to display to All Users then a -1 is written to the table when it's saved. I'm also not seeing a FK constraint against the Roles table in the TabsPermission table.

 
New Post
5/31/2008 4:54 PM
 

Mike Horton wrote

<snip />

I guess my last question, and I can see why you may not have tried this yet in case it made things worse, is have you tried setting the RoleID back to an int in your database?

Yes it does. I altered it to int with Identity in Roles and int in UserRoles (this gets done automatically by SQL Server if they have related keys related) and now adding roles works. Still no luck on tracking down how this happened though.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationNegative RoleIds and RoleID varchar(50)Negative RoleIds and RoleID varchar(50)


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out