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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Adding role to userAdding role to user
Previous
 
Next
New Post
5/18/2006 10:23 AM
 
I thought I would do a really simple customization, and that is to automatically create a role (based on username) and assign this role to the user when they are created. My first thought was to use one of the sproc's that fire on user add, and add some code there to add them to the role. But my problem is, I can't get the roles to take by directly adding them to the database. I've added it to the DNN_Roles, DNN_UserRoles, aspnet_Roles and aspnet_usersInRoles. After doing this, I can see the correct assignments in the DNN admin, but when I assign module access to their role, it doesn't work.

So, two questions:

1. With this approach, any idea why it's not working?

2. Should I try a different approach, if so, can you give me a little direction to point me the right way?

Thanks!
 
New Post
5/18/2006 4:25 PM
 

adding users and roles is not only done in SQL, but also in the business layer, because the membership provider needs to add the proper information to the asp_net membership tables. If you want to find out how to create users, roes, and assign roles to users, have a look at the admin modules that do things like that

cheers,

erik


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
5/18/2006 7:21 PM
 
I hear what your saying, and you are right. However, I still went ahead and brute forced a way to do it in the database. How I did it was to modify the aspnet_Users_CreateUser and AddUser procedures. I added code to auto assign a role in both places and that seemed to do the trick. This produced the behavior I wanted without messing with the code.

Thanks for the reply.
 
New Post
5/21/2006 12:41 PM
 
Well, i guess i spoke to soon. The users are being created with proper role assignments, however, they don't have access until I refresh the web.config. Not sure why, but I guess I created my own monster by bypassing the bll of dnn. Back at square one again...
 
New Post
5/21/2006 1:44 PM
 
note, that user and roles are cached.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Adding role to userAdding role to user


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