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.0get page rolesget page roles
Previous
 
Next
New Post
9/18/2008 10:09 PM
 

I have a website with a custom login module.

In this module I am trying to redirect the user to the home page set up in the settings (PortalSettings.HomeTabId) but only if the user has the correct role to view that page, I have got this functionality by hardcoding the role and I could also hardcode the role in the web.config but the most flexible solution would be to have some method return the permissions for PortalSettings.HomeTabId and if the user has a role that allows them to view the page, redirect them.

Does anyone have any idea of how to do this?

 

 
New Post
9/24/2008 10:58 PM
 

I figured it out and just thought i would post it here incase anyone else is ever looking to do something sililar:

DotNetNuke.Entities.Tabs.TabController tabController = new DotNetNuke.Entities.Tabs.TabController();
DotNetNuke.Entities.Tabs.TabInfo tabInfo = tabController.GetTab(this.PortalSettings.SplashTabId, this.PortalId, false);
 
The tabInfo class has a TabPermissions list that can be iterated to find the roles that the splash page contains.

 

 

 

 
New Post
9/25/2008 3:42 AM
 

 This is a very basic and a quick attempt by me to find the permission setting

 

DotNetNuke.Security.Permissions.TabPermissionCollection tabPermColl = new DotNetNuke.Security.Permissions.TabPermissionCollection();
DotNetNuke.Security.Permissions.TabPermissionController tabPermCont = new DotNetNuke.Security.Permissions.TabPermissionController();
tabPermColl = tabPermCont.GetTabPermissionCollectionByTabID(TabID, PortalID);//Use PortalSettings.HomeTabId for TabID
foreach(DotNetNuke.Security.Permissions.TabPermissionInfo tpi in tabPermColl)
{
    //Check the properties of tpi (such as tpi.rolename) to check what it can do.
}
 

I think that will be a good starting point for you.

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0get page rolesget page roles


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