Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AspDotNetStoreFront
  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Adding role to user
Previous Previous
 
Next Next
New Post 5/18/2006 8:23 AM
User is offline Rick Lamb
24 posts
10th Ranked


Adding role to user 
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 2:25 PM
User is offline ErikVB
3073 posts
www.apollo-software.nl
4th Ranked










Re: Adding role to user 

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,
a view from my attic, my personal blog

The personal blog of Erik van Ballegoij

 
New Post 5/18/2006 5:21 PM
User is offline Rick Lamb
24 posts
10th Ranked


Re: Adding role to user 
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 10:41 AM
User is offline Rick Lamb
24 posts
10th Ranked


Re: Adding role to user 
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 11:44 AM
User is offline Sebastian Leupold
15226 posts
www.deutschnetnuke.de
1st Ranked












Re: Adding role to user 
note, that user and roles are cached.
Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Adding role to user
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Lucede Systems Group
Providing a full range of IT services for large and medium sized companies
www.lucede.com
Adaptive InfoSystems, Inc.
We provide custom programming and various levels of support for DotNetNuke and the .Net framework.
www.aisysweb.com
Multipartner Virtual Data Rooms
The Virtual Data Rooms (VDR) provided by an expert advisor, far from any ordinary software company!, supporting the sellers and their consultants. Multipartner builds and services higly professional Virtual Data Rooms (VDR) specifically tailored to M&A, Real Estate and NPL deals.
www.multipartner.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP