Module Permission to display RSS is always false
Last Post 03/31/2017 12:30 PM by Andy Stephenson DNN Creative. 1 Replies.
Author Messages
KJ Singh
Posts:


--
03/22/2017 5:28 AM  
Am new to DotNetNuke and trying to debug an issue regarding RSS feed of a Module. Basically the module displays 3 news item and I have ticked the option Allow Syndicate which then displays the RSS icon on the front end with a link to the feed.

The RSS icon displays fine with a link to the Feed but the actual feed contains no data at all. The news item do not exist.

Anyhow looked into the code behind for the RSS and it fails on permissions where objModule.DisplaySyndicate is always false even with the selected option to display the RSS?!?! Here is the code that governs that


Private Function PermissionToDisplayRSS(ByVal objModule As ModuleInfo, ByVal TabId As Integer, ByVal ModId As Integer) As Boolean
Dim UserHasPermission As Boolean = False
If PortalSecurity.IsInRoles(PortalSettings.ActiveTab.AuthorizedRoles) And PortalSecurity.IsInRoles(objModule.AuthorizedViewRoles) Then
If PortalSettings.ActiveTab.StartDate < Now And PortalSettings.ActiveTab.EndDate > Now Then
If objModule.DisplaySyndicate And Not objModule.IsDeleted Then
If CType(IIf(objModule.StartDate = Null.NullDate, Date.MinValue, objModule.StartDate), Date) < Now And CType(IIf(objModule.EndDate = Null.NullDate, Date.MaxValue, objModule.EndDate), Date) > Now Then
UserHasPermission = True
End If
End If
End If
End If
Return UserHasPermission
End Function


And this is the Method that renders the RSS feed


Private Function BuildFeedItems(ByVal TabId As Integer, ByVal ModuleId As Integer) As String
Dim objModule As ModuleInfo
Dim sb As New StringBuilder()
objModule = objModules.GetModule(ModuleId, TabId)
If PermissionToDisplayRSS(objModule, TabId, ModuleId) Then
Select Case objModule.DesktopModuleID
Case 50
sb.Append(RenderTextHtmlItems(objModule, ModuleId))
Case 69
sb.Append(RenderNewswireItems(objModule, TabId))
Case 107
sb.Append(RenderEquipmentNewsItems())
Case 215
sb.Append(RenderRecommendedEquipmentItems(objModule, ModuleId))
Case 254 ' blogs
Case 272 ' blogs
sb.Append(RenderBlogItems())
Case Else
End Select
End If
Return sb.ToString
End Function


Am not sure where else the permission be set for the module which would be preventing it from being set to true?

Any suggestions?
Andy Stephenson DNN Creative
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:169


--
03/31/2017 12:30 PM  
Sorry but we don't cover much about DNN coding here. More admin and design/theme


---