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.0how to manage permissions on a control in a module ?how to manage permissions on a control in a module ?
Previous
 
Next
New Post
1/13/2009 6:31 AM
 

Hye i have several controls in a module but with different permissions. Is there something like the permissions settings of module setting but for the controls...  or i must code the test for the rights for each control ?

Thanks,  

bye

 
New Post
1/14/2009 5:41 PM
 

You can add extra custom permissions to the module.  Check out the User Defined Table to see how this is done.


Philip Beadle - Employee
 
New Post
1/21/2009 2:31 PM
 

I am looking to add a few custom permissions to a module I am writing as well.  I have looked at the UserDefinedTable, and it's definatley doing what I want to do.  The trouble is, I am not able to acertain where in the code it's accomplishing this feat.  Could someone maybe outline the process briefly and which files are of interest?

Thanks.

 
New Post
1/21/2009 8:05 PM
 

Okay, I found it and will post it here for any of you who may have the same trouble.

The code is located in the Controller class inside a procedure called: InitPermissions()

This procedure only needs to run once though should be able to run many times and detect if the permissions have already been added or not.  In the case of the UserDefinedTable's implementation, they call the procedure upon the upgrade event.  I could not get this event to fire in my newly created module, so as a work around I call the InitPermissions proc from my instanciation procedure (public sub new).  I'd really rather not do this though because the function runs every time I create an instance of my class.

Could someone tell me what triggers the upgrade event to be fired so I can cause that to happen for my new module?  Or is there some other event that I could use to run this code on install?

 
New Post
1/21/2009 9:59 PM
 

Here's Vicenc Masanas's original blog entry regarding setting up custom permissions:

http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryId/1052/Custom-Module-Permissions-Enhance-your-modules.aspx

Note that in the new universal package installer introduced in DNN 5, it will be possible to create custom permissions simply by writing the appropriate elements in the .dnn manifest file.

Regarding the UpgradeModule callback, here's a very quick outline of what is necessary to have your custom code be called:

1. Implement the IUpgradable interface in your module's business controller class.

2. When the module is installed, the installer should correctly identify that IUpgradable is supported. If implementation of the IUpgradable interface is properly being detectedyou should be able to see that "Supported Features: Upgradable" is checked when examining the module's definition. If not, make sure that your module's business controller class is properly specified.

3. UpgradeModule will be called for each module version (greater than that currently installed) up to and including the current version PROVIDED THAT  a xx.xx.xx.SqlDataProvider file has been created for each version and is included as part of the module package. Even if no SQL update is required for a particular version, a blank xx.xx.xx.SqlDataProvider file must be present for UpgradeModule to be called for version xx.xx.xx of the module.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0how to manage permissions on a control in a module ?how to manage permissions on a control in a module ?


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