Dnn.platform: Increase Role Name Length

Created on 4 Oct 2018  路  8Comments  路  Source: dnnsoftware/Dnn.Platform

Description of problem

Increase the length of the Role Name field. It is currently set to a max length of 50.

Description of solution

Update the Roles table and make the RoleName column a nvarchar(150) or higher

Additional context

We use Roles a lot to associate DNN users to Industries or Departments and with a length of only 50 we have to abbreviate or utilize naming conventions.

Affected version

  • [x] 9.2.2
  • [x] 9.2.1
  • [x] 9.2
  • [x] 9.1.1
  • [x] 9.1
  • [x] 9.0

Solution

We have performed this on several sites by completing the following.
Update the following SQL table:
ALTER TABLE [Roles]
ALTER COLUMN [RoleName] NVARCHAR(250) NOT NULL

Updating the RoleName parameter to a NVARCHAR(150) or higher in the following stored procedures:
[dbo].[AddRole]
[dbo].[Export_RoleIdByName]
[dbo].[GetNonExpiredUsersByRoleName]
[dbo].[GetUserRolesByUsername]
[dbo].[GetUsersByRolename]
[dbo].[UpdateRole]

Update the \DesktopModules\Admin\Dnn.PersonaBar\Modules\Dnn.Roles\scripts\bundles\roles-bundle.js file so that the MaxLength on the Name field is 150 or higher.

AE > PersonaBar Ext > Roles.Web Low Low Ready for Development Enhancement help wanted stale

Most helpful comment

Also there could be an issue with multiple roles and storage. I would be a fan if nothing more than 100 for many reasons

All 8 comments

I agree, 50 might be a bit too small, but considering nested roles in the future, we should not make them too large, which would prevent us from creating and indexing role paths. Wouldn't 100 characters be sufficient for you as well?

I was going to weigh in that 50 seemed about right... certainly for the "Name" of something in the system. 100 or 150 characters would be too long to display in many of the dropdown/checkbox selection areas where you currently assign permissions.

One question I'd have is whether you are using the Description field? That would seem more applicable to a length of text that describes a role. Perhaps, instead of making the Role Name field longer, would it help to have a tooltip or similar action to display the Description?

Also there could be an issue with multiple roles and storage. I would be a fan if nothing more than 100 for many reasons

the AD provider creates roles and might get issues with role names, as they are created as "domain\AD_RoleName", therefore it might make sense to increase length of this property (still not above 100 chars), but I wouldn't increase space for it in tables and forms.

I agree, 50 might be a bit too small, but considering nested roles in the future, we should not make them too large, which would prevent us from creating and indexing role paths. Wouldn't 100 characters be sufficient for you as well?

100 characters would certainly help and would solve our issue in most cases.

I am putting this for 9.4.1, correct me if I am wrong, but I don't think this would be a breaking change right?

We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically.
If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!

This issue has been closed automatically due to inactivity (as mentioned 14 days ago). Feel free to re-open the issue if you believe it is still relevant.

Was this page helpful?
0 / 5 - 0 ratings