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  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Webhost4Life - $4.95 Windows Hosting
 


  Sponsors  

Meet Our Sponsors

SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Adding role to user
Previous Previous
 
Next Next
New Post 5/18/2006 7: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 1:25 PM
User is offline ErikVB
2827 posts
www.apollo-software.nl
5th 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

DNN OpenForce 2008... Register Now!
 
New Post 5/18/2006 4: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 9: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 10:44 AM
User is offline Sebastian Leupold
14288 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.

 


DotNetNuke Modules, Skins, Training and Consulting
If you want DotNetNuke done right then look no further. Developed Solutions provides module development, skin design, user and developer training and consulting. Based in Adelaide, Australia, we offer our services worldwide.
www.developedsolutions.com.au
Venexus, Inc.
Need custom a custom DotNetNuke module? From module planning to deployment, including training and support, Venexus developers deliver end-to-end web solutions on time and on budget.
www.venexus.com
Bring2mind
Document Centric DNN Module Solutions
www.bring2mind.net

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