Meaning "IsPublic" for DotNetNuke Roles.

DotNetNuke Roles have "IsPublic" attribute. I wandered what the business meaning of the value. After reading the 4.0.2 code my understanding that if IsPublic=true, user is able to subscribe to the role, if it is free (see DotNetNuke\admin\Security\Register.ascx.vb).
I didn't find any more business logic coded.
It seems that even if public=false, role is visible to user and even available for payed subscription.
(I haven't tested it yet.)

 

Lazy roles Synchronization in DotNetNuke.

There is a thread: Role SynchronizationMode that asked what the meaning of the parameter in core AddRole method.
I investigated ability to syncronize roles from custom database to DNN and can post answer for this question(according to 4.0.2 core).

Parameter SynchronizationMode is used to implement “lazy” synchronization for roles.

If new role has been added to AspNet_Roles DNN calls synchronization to update satellite dnn_Roles table.

 

Parameter SynchronizationMode is used in RoleController.AddRole to indicate whether the role should be added to both the AspNet_Roles and dnn_Roles(SynchronizationMode=false) or to dnn_Roles only (SynchronizationMode=true).

The common use is to call AddRole(ByVal objRoleInfo As RoleInfo) overload, which corresponds to SynchronizationMode=false.

 

The call stack for syncronization (SynchronizationMode=true )is the following:

DotNetNuke\admin\Security\Roles.ascx.vb: BindData ->

RoleController.GetPortalRoles(PortalId, True)->

RoleController.SynchronizeRoles(PortalId)->

objRoleController.AddRole(objRoleInfo, True)

 

There is also method

RoleController.GetRoleByName(ByVal PortalId As Integer, ByVal RoleName As String, ByVal SynchronizeRoles As Boolean) that also can be called to synchronize roles,  

but I didn’t find that is is called from anywhere with SynchronizeRoles=true.

 

«May»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910