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.0Programatically hide module actionsProgramatically hide module actions
Previous
 
Next
New Post
1/7/2007 11:22 PM
 
Ok... here's one I can't seem to figure out.

I've got a client that wants (demands) that I hide some of the actions (import, export, clear cache) within the container actions list.  But he only wants some of them removed and only for certain roles.  I fully realize this means a custom modification to the core architecture, but I can't seem to figure out where.  I've been looking at the PortalModuleBase.vb file and figure I must be close.  Where does DNN store (or make the determination) the actions available to the different types of modules.  My plan is to intercept the request, perform a role check and either permit of terminate the request at that point... Any better thougths?  HELP!!
 
New Post
1/8/2007 9:27 AM
 

Those should only show up for administrators. Are there Administrators that he does not want to see the options?

Also, this tutorial may help:

IActionable: Add Items to Your Module Menu (VB &C#)



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
1/22/2007 3:31 PM
 
The article shows how to add menu action items.  I am looking for the answer posed earlier: How do you remove or delete menu action items?   Yes, I want some of the menu items deleted even for an administrator.

Any ideas?
 
New Post
1/22/2007 5:14 PM
 

To answer the original question (and to clarify Michael's response).

The actions are added in the LoadActions method of PortalModuleBase.

The following actions are set as Admin (so only show to Administrators):

  • Export
  • Import
  • Settings
  • Delete
  • ClearCache
  • Move

So IF you want these disabled from Admins you can modify the code in Load Actions (not recommended).

Alternatively, make the users that shouldn't see the actions members of a different role, and add that role to the Edit permissions of the module.  In that way the user can "edit" the module but NOT do the other actions listed above.


Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
New Post
2/4/2011 8:55 AM
 
I was hunting for the same solution but no luck so I thought I would post my solution to this problem here. Not certain if this is the "correct" way of doing this, but thought I would offer it as a possibility.

I needed to "hide" certain action menu items as well, as they were unneeded for the module I was developing, so I dropped this into the page_load:

foreach (ModuleAction action in Actions)
{
    if (action.Title == "Export Content" || action.Title == "Import Content" || action.Title == "Print")
    {
        action.Visible = false;
    }
}

Suggestions on improvements or more graceful ways of handling this are more than welcome.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Programatically hide module actionsProgramatically hide module actions


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