Hello,
We have upgraded a DNN 7.0.4 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
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?