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

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...API to know if edit permission is allowed on Edit user control of acustom moduleAPI to know if edit permission is allowed on Edit user control of acustom module
Previous
 
Next
New Post
5/12/2013 4:52 PM
 

I have a custom module that I have built.

In the View user control, a URL to Edit user control is showing if logged in user has edit permission for this custom module. This edit needs to be there many times even when page hosting the module is not editable. How do I know in View user control if the module ( not page) is allowed to be edited?

View User Control inherits as below:

Public Class editExamTracker
        Inherits DotNetNuke.Entities.Modules.PortalModuleBase

View User Control HTML for showing the Edit URL:  I tried using IsEditable property, but it appears that this property in base class of PortalModuleBase tells whether the page is editable and not whether the Edit user control is accessible..

<asp:HyperLink id="hlExamTrackerID" runat="server" Visible="<%# IsEditable %>" NavigateUrl='<%# EditURL("ExamTrackerID",DataBinder.Eval(Container.DataItem,"ExamTrackerID")) %>' ImageUrl="edit.gif" Text="Edit">


 

 

 
New Post
5/13/2013 3:27 AM
 

Sunil,

the base.IsEditable property should exactly do what you need. Please keep in mind that if the user has Edit permissions on the page level, he will have edit permissions on the module as well.

In my opinion, he should not have this permission if you explicitely forbid it on module level, but this is not this way. There is an issue in Gemini about that.

Best wishes
Michael


Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
 
New Post
5/13/2013 8:43 PM
 
Michael,

Thanks for the answer.

There is just one catch when using DNN 7.00.04 and above.
When a user lands on a page to which user has edit permissions at module level ( bit not page level), the control panel displays 'Edit this Page' by default. Till the user does not click on Edit this page in control panel, the IsEditable property for the module will be false. So that is the catch.

Is there a way to get the corect value for IsEdtable property as soon as the page lands on the page? YES, there is a way.

You have to go to Admin > Site Settings > Advance Settings Tab> Usability Settings section> Control Panel Security property and set it to Page Editors. So, when you land on a page for which you do not have any edit permissions the 'Edit This Page' button will not show up and at the same time the IsEditable property for a module on this pagewill show the correct value.
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...API to know if edit permission is allowed on Edit user control of acustom moduleAPI to know if edit permission is allowed on Edit user control of acustom 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