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.0Add Roles, Check Roles on Module InstallAdd Roles, Check Roles on Module Install
Previous
 
Next
New Post
11/1/2007 10:22 AM
 

Hello,

How can I add new roles when my modules gets installed? The module I am build to learn DNN module build needs two roles to work with. I want to add these roles to DNN when I install. Is this a good idea, is there another way to do this?

Also, in the Usercontrols how do I check what the current user role is?

Thanks.

 
New Post
11/1/2007 10:33 AM
 

I don't think there is any mechanism to allow this on the install.  However, you can do this in your module the first time it loads.  The caveat here is that you will need to check this the first time the modules every time.  Another method would be to have a method set-up in the settings of the module to create the roles on command.

To check the role of the current user:

Me.UserInfo.IsInRole("ROLE_NAME")


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
11/1/2007 10:43 AM
 

howard wrote

How can I add new roles when my modules gets installed?

I would look into using the IUpgradable interface.

HTH's,

Dave

 
New Post
11/1/2007 11:00 AM
 

A module shall not rely on specific roles - except the "virtual" ones: all users, registered users and unauthenticated users. All other roles are subject to the portal.

Modules can however provide different access by providing individual permissions, have a look at the permission grid of UserDefinedTable and new Forums modules for example.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
11/1/2007 11:22 AM
 

That is a great point.  It would be better to follow the pattern of a module like the forums module, where you add another set of permissions to use.  This way, you can specify the roles in the Module Settings.

I cannot find the link I had for doing this, but looking at the source code should give you an idea.


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Add Roles, Check Roles on Module InstallAdd Roles, Check Roles on Module Install


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