0
votes

We have upgraded a DNN 7.1.2 professional edition to DNN 9.0.1. The upgrade went smoothly without any error. However when accessing the upgraded website none of the modules were being loaded on the page. At the same time I would like to highlight that correct skin menu etc were being loaded. After debugging a lot I was able to locate he issue in a dll by name DotNetNuke.Profession.dll. This dll has a class by name GranularPermissionProvider which checks if the modules needs to be shown on a page or not based on the current user permission. The culprit code seems to be below:

GranularPermissionProvider.cs

//code in DotNetNuke.Professional

public override bool CanViewModule(ModuleInfo module)
{
  if (!this.Application.HasActiveLicenseOrIsTrial)
    return base.CanViewModule(module);
  if (!PortalSecurity.IsInRoles(module.ModulePermissions.ToString("VIEW")))
    return PortalSecurity.IsInRoles(module.ModulePermissions.ToString("EDIT"));
  return true;
}

Whereas the code in the base PermissionProvider.cs class is as following.

/// <summary>
/// Returns a flag indicating whether the current user can view a module
/// </summary>
/// <param name="module">The page</param>
/// <returns>A flag indicating whether the user has permission</returns>

public virtual bool CanViewModule(ModuleInfo module)
{
    bool canView;
    if (module.InheritViewPermissions)
    {
        TabInfo objTab = TabController.Instance.GetTab(module.TabID, module.PortalID, false);
        canView = TabPermissionController.CanViewPage(objTab);
    }
    else
    {
       canView = PortalSecurity.IsInRoles(module.ModulePermissions.ToString(ViewModulePermissionKey));
    }
    return canView;
}

If you look closely the base code checks if the module inherits the page permission or not which is completely missing from the GranularPermissionProvider class. I suspect that this is the issue due to which modules are not being loaded. I was wondering if there is a fix for the same?

1

1 Answers

0
votes

Did you upgrade from DNN Professional (or Evoq) to the community edition of DNN? If so there may be other issues with which you have to deal. Certainly the permissions thing could be one of them.

You could try visiting the "Pages" admin function. That should show you a list of all of your pages. You can visit them, and should be able to see the list of modules installed, and you should be able to edit module permissions there.

You may also be able to install Oliver Hine's (oliverhine.com) permission provider that provides the same functionality to DNN as is in Evoq.

Just some ideas ...