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 ExtensionsModulesModulesHide all module on a pageHide all module on a page
Previous
 
Next
New Post
1/25/2013 5:49 AM
 

Hello All,

 I want to build a module that could validate (stored procedure in database) if user is eligible to see modules on the page where my new module could be dropped. I was try to find something in API but I could not. Of course I could get a dictionary of modules:

if (Page.IsPostBack == false)
            {
                ModuleController objModuleController = new ModuleController();

                var tabModules = objModuleController.GetTabModules(TabId);

            
                
                
                foreach(KeyValuePair<int,ModuleInfo> entry in tabModules)
                {
                    
                }

            }

But I cannot find how can I hide modules on runtime. I guess I am on the wrong direction.

Could somebody provide some simple idea or guideance

 Thanks

 
New Post
1/25/2013 6:44 AM
 
I think you need to say more about what you are trying to do.

Usually this is handled by permissions. If the user has edit permission for the page then they can add modules. If they do not have edit permission then they cannot.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
1/25/2013 7:02 AM
 
Like Richard stated, use the security built-in security. Add the users to specific roles and allow only those roles to view the module and that should work.

Mark
 
New Post
2/3/2013 9:44 AM
 
Hello All,

Thank you all for your comments. I guess I need to describe it more. Of course best would be to handle all of this using built in security. But that does not work for me since I have to validate user each time he access page. What I actually want to do is to validate if user has correct mail address. If he has correct mail address then I show modules on the page, if does not then I do not show modules. I was considering using sql scheduler for that and have stored procedure that checks people and adds them or drops them from dnn role. But I am affraid that dnn cache might not refresh.... or something else.... Everybody is saying that it is better to do those things using API. So I thought I will create a module that could check user address and show or hide modules when he access the page where module is installed.

So still it would be great if somebody could assist me on this topic.

Thanks
 
New Post
2/3/2013 10:52 AM
 
What does validating an email address mean?

If you set the site security appropraitely then new members will get an email and they have to click on a link to complete registration. That vaildates the email address at that time.

It can't prevent them closing the email account next week.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHide all module on a pageHide all module on a page


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