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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesMaking DNN module Action button visible for a specific User NameMaking DNN module Action button visible for a specific User Name
Previous
 
Next
New Post
2/11/2012 4:39 PM
 

Hi All --

I have got purchased a DNN module with sources from a third-party DNN modules developer and they are not in active DNN development nowadays, therefore they can't help me and I'm asking my question here: 

- there is the following code fragment in the subject module's View*.ascx:

public ModuleActionCollection ModuleActions
        {
            get
            {
                ModuleActionCollection Actions = new ModuleActionCollection();
                Actions.Add(this.GetNextActionID(), "Form Settings", ModuleActionType.AddContent, "", "", this.EditUrl("MyModuleSettings"), false, SecurityAccessLevel.Edit, true, false);
                Actions.Add(this.GetNextActionID(), "View Questions", ModuleActionType.AddContent, "", "", this.EditUrl("MyFormQuestions"), false, SecurityAccessLevel.Edit, true, false);
                return Actions;
            }
        }

AFAIU this code fragment makes two module actions' link buttons visible for the users having Edit rights for this module. What I need to do is to make [View Questions] module action link button visible additionally for a specific User Name. How can I do that in module's code (i.e. without giving module edit rights to the user)?

Thank you.

-- Shamil


 
New Post
2/12/2012 4:10 AM
 

   Try change your code as followings:
  
    public ModuleActionCollection ModuleActions
        {
            get
            {
                ModuleActionCollection Actions = new ModuleActionCollection();
                Actions.Add(this.GetNextActionID(), "Form Settings", ModuleActionType.AddContent, "", "", this.EditUrl("MyModuleSettings"), false, SecurityAccessLevel.Edit, true, false);
               if (UserId!=-1&&UserInfo.Username.ToLower()=="abc")
                {

                    Actions.Add(this.GetNextActionID(), "View Questions", ModuleActionType.AddContent, "", "", this.EditUrl("MyFormQuestions"), false, SecurityAccessLevel.View, true, false);
                }
 
                return Actions;
            }
        }

      Then user "abc" can view "View questions" action button. Note, you also need change "MyFormQuestions" module permission from "Edit" to "View". Otherwise, "abc" can't open it.


Over 20 + professional dnn modules for News Article, Store, Video Gallery, Photo Gallery, Ultra Flash Player,YouTube Video, Image Slide show, Skin Chameleon and much more from DnnModule.com
 
New Post
2/12/2012 5:55 PM
 
Thank you, it worked well. I have got it edited this way:

public ModuleActionCollection ModuleActions
{
get
{
ModuleActionCollection Actions = new ModuleActionCollection();
if (UserId!=-1&&UserInfo.Username.ToLower()=="abc")
{
Actions.Add(this.GetNextActionID(), "View Questions", ModuleActionType.AddContent, "", "", this.EditUrl("MyFormQuestions"), false, SecurityAccessLevel.View, true, false);
}
else
{
Actions.Add(this.GetNextActionID(), "Form Settings", ModuleActionType.AddContent, "", "", this.EditUrl("MyModuleSettings"), false, SecurityAccessLevel.Edit, true, false);
Actions.Add(this.GetNextActionID(), "Form Settings", ModuleActionType.AddContent, "", "", this.EditUrl("MyModuleSettings"), false, SecurityAccessLevel.Edit, true, false);
}

return Actions;
}
}

Still one issue remains:

- I do use "View Questions" action redirecting me to MyFormQuestions.ascx (one of View mode controls of my DNN module), and the latter is displayed using default DNN site skin not my custom skin, which is used for when displaying calling control (control with "View Questions" action link).

Is there any way to display MyFormQuestions.ascx View mode control using my custom skin, which is assigned as default skin for module owning/hosting MyQuestions.ascx?

I guess

this.EditUrl("MyFormQuestions")

part of the code should be replaced with something like

this.ViewUrl("MyFormQuestions")

but this.ViewUrl(...) method is missing in the base class PortalModuleBase...

How should I fix the code? - Will DotNetNuke.Common.Globals.NavigateURL("MyFormQuestions") work well?

Thank you.

-- Shamil
 
New Post
2/12/2012 6:47 PM
 
I should set this thread status as 'Resolved' - the remaining issue I mentioned in my last posting of this thread: "Having multiple views of a module displayed using custom DNN site skin not administration skin (the latter one, admin modules skin is in my case set as a different skin)" was addressed many times AFAIS:

http://technicalsmile.blogspot.com/2011/05/more-than-one-view-or-edit-controls-in.html

http://kemmis.info/blog/archive/2009/05/05/managing-views-in-your-dotnetnuke-module.aspx

and that remaining issue has some solutions - I can try to develop them later...
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesMaking DNN module Action button visible for a specific User NameMaking DNN module Action button visible for a specific User Name


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