Products

Solutions

Learn More

Partners

Community

Blog

About

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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUpdating role name inside module.Updating role name inside module.
Previous
 
Next
New Post
8/14/2012 2:48 AM
 

Hi

I have a need to allow updating of role names and have this code so far.

RoleInfo role = oDnnRoleController.GetRoleByName(PortalSettings.Current.PortalId, old_role_name);
role.RoleName = new_role_name;
oDnnRoleController.UpdateRole(role);

However if I run this part of the code and examine the sql sent here it seems to pass in the old value for the name, despite the fact that if I put a break-point on the bottom row of the above code role at that point has the new role name.

Can anybody tell me what I am doing wrong please :)

Thanks.

JHF

 
New Post
8/14/2012 7:17 PM
 
I don't think we support the renaming of roles, though I haven't tried it myself in code.

Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
8/15/2012 1:05 AM
 

Hi,

Okay so the API doesn't do it although you would think it should since it updates the rest of the role details.

Would there be any issues If I do my own update code instead of using the API and just update that field in the database.

JHF

 
New Post
8/19/2012 7:50 PM
 
Hi,

We sometimes would like to change a Role name, for example aSocial Group name needs to be changed at a later date.

Can anyone explain to my why we can't change role names? Is this only because some legacy third party modules depend on the Role name? Are there any problem with DNN 6.2 core or modules with changing a role name? Is it a cache problem?

What kind of problems will we encounter if we directly change the Role name?

Thanks,
Chris
 
New Post
8/20/2012 8:51 AM
 
Chris,

I did that sometimes to remove a typo or so... And I think it's really that easy to do it in the Roles table by an SQL statement like this in Host :: SQL:

UPDATE {databaseOwner}{objectQualifier}Roles
SET RoleName = 'newRoleName'
WHERE RoleName = 'oldRoleName' AND PortalID = xy

where xy is your current PortalID. Check "Run as script" and execute. Then you should clear the cache.

I never touched predefined roles like "Administrators", "Subscribers" and "Registered Users", and I cannot tell you which effects this will have when you use a third-party membership provider.

Please note: To do this is at your own risk. Don't bother me if something goes wrong.

Best wishes
Michael

Michael Tobisch
DNN★MVP
dnn-Connect.org - The most vibrant community around the DNN-platform
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUpdating role name inside module.Updating role name inside module.


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.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  

What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out