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.0Custom Module PermissionsCustom Module Permissions
Previous
 
Next
New Post
1/6/2009 4:57 PM
 

I was faced with the problem of adding permissions other than 'View Module'  and 'Edit Module' to a module I'm developing not long ago, and after reading an excellent article by Vicenç Masanas on the subject (and some tinkering) I managed to get something together. And 'cause I'm nice I tidied up my notes on the process and posted them on my web site for your edification and enjoyment. So run, don't walk to my scribblings on the subject if you're interested...

 
New Post
1/6/2009 5:28 PM
 

Very nice article ... well done.

My only comment is about the presentation and not the content, and is only meant as a suggestion to improve the readability.   The source code snippets are a little hard to read with the color combinations and the background highlighting.  I would suggest looking at something like http://manoli.net/csharpformat/format.aspx, which is a great web site for formatting source code, whether it's c#, vb,html or xml.

You just paste your code, hit a button and then copy the results to your web page, blog or module. 

If you are using LiveWriter, there are some great source code formatter plug ins.

So, using the http://manoli.net/csharpformat/format.aspx web site, your source code snippets could look like this .. which is much easier to read.

   1:  using DotNetNuke.Security.Permissions;
   2:  using DotNetNuke.Entities.Modules;
   3:  using DotNetNuke.Entities.Modules.Definitions
   4:  using System.Collections;
   5:   
   6:  public string UpgradeModule(string Version)
   7:  {
   8:      if (Version == "01.00.00")
   9:     {
  10:        // Install module permissions 
  11:        InitModulePermissions();
  12:     }
  13:     return Version;
  14:  } 

regardless, excellent article and thanks for sharing with the community!

 

 
New Post
1/7/2009 2:07 PM
 

Very nice, I've been looking for something like that...

Thanks for the link!

Frauke

 
New Post
2/12/2009 9:41 AM
 

Why do you think it would be a bad thing to put the permission init in Page_Load?

In Page_Load of the settings control, I check for the existence of custom permissions and add them if needed. Anywhere I use those custom permissions, if they don't exist, I just assume the user doesn't have permission. So, once you create your module, go to the settings page and they're all there.

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Custom Module PermissionsCustom Module Permissions


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