Will "the Mighty" Strohl

HOW TO: Automatically Add Users to Roles in DotNetNuke®

Have you ever wanted to just send someone a link to grant them access to an area on your site?  That seems to be the easiest way to do so, right? 

It is actually quite easy to accomplish this in DotNetNuke®, using the RSVP feature in the Security Roles module.  First, log in as an administrator.  Once you are logged in, go to the Security Roles page in the Admin Menu.

Choose

Once you see the Security Roles module, click Add New Role.

Click

This will bring you to the role editor.  Enter the information into the Basic Settings like you always would.  However, there is an extra step in the Advanced Settings.  Enter in a code into the RSVP Code field.  To keep it simple, I would suggest whatever you use here to contain only letters and numbers.  No spaces or special characters.  I don't know what will happen otherwise.  Also, DO NOT enter a value for the RSVP Link field.

Enter a value (text only) into the RSVP Code field

Click the update link button at the bottom of the module to save your changes.  Once your changes are saved, you should be looking at the Security Roles module again, but the first view (like shown earlier).  However, this time you should see your new role in the list of roles.  Click on the pencil next to your new role name.

Click on the pencil next to your new role name

Now, go directly to the Advanced Settings area for your new role.  Notice that the RSVP Link field now has a value entered for you.  Copy this URL.

Copy the URL in the RSVP Link field

Now, paste this URL wherever it is that you need to distribute it (e.e., newsletter, members only area, etc.).

Now comes the part that is not so user friendly...  Your visitors will receive the RSVP Link in some way.  Let's assume it was in an e-mail.  First of all, know this.  They will not get ANY feedback under either of these scenarios.

If the visitor clicks on the link when they are still logged in to your site, mostly everything will be fine.  However if this code unlocks some special content, the visitor will need to log off and then log back in before the new role will take effect.  Not fun for them, and not a fun e-mail to answer in the morning.

If the visitor is not logged in, they will certainly have no way to know it, but they need to log in before the RSVP Code is applied to their user account.  Once they log in, there will be no feedback to tell them that they are added or not.  Only the administrator will know, but it still has to be looked up.  And once again, the visitor will need to log off and then log back in to see any new content or features.

For the two above reasons, I would suggest this...

Add a page on your site with instructions on how the RSVP process works.  Just be sure to keep the instructions short and simple.  There is no need to bore them with details that they do not care about and will not read.

Alter the RSVP Link before you send it out.  You cannot alter the URL in the Security Roles module.  Besides, the RSVP Code will be picked up from any page on your site.  Use the URL for the page you just created that has the RSVP instructions.  Just make sure that at the end of the URL you have the rsvp querystring key and value appended to it.  For example:

http://www.domain.com/Home/RSVP/tabid/123/Default.aspx?rsvp=TESTROLE

That is all there is too it.  It isn't the most elegant process, and it will not earn you a ton of kudos from the Marketing Department, but you can indeed get the job done.



blog comments powered by Disqus