Hello,
I've used to do this:
Dim objModule As DotNetNuke.Entities.Modules.ModuleInfo
Dim viewRoles As String = objModule.AuthorizedViewRoles
However, AuthorizedViewRoles was Deprecated in DNN 5.1. All permission checks are done through Permission Collections.
Its implementation is/was:
'<XmlIgnore()> Public ReadOnly Property AuthorizedViewRoles() As String
' Get
' If String.IsNullOrEmpty(_AuthorizedViewRoles) Then
' If InheritViewPermissions Then
' _AuthorizedViewRoles = TabPermissionController.GetTabPermissions(TabID, PortalID).ToString("VIEW")
' Else
' _AuthorizedViewRoles = ModulePermissions.ToString("VIEW")
' End If
' End If
' Return _AuthorizedViewRoles
' End Get
'End Property
My doubt/question is: which would be the right not-obsolete way to get this same information in one step?
Clearly, call ModulePermissions.ToString("VIEW") is not enough because as this property does, you have also to check for InheritViewPermissions.
Many thanks,
Horacio.-