Hi all,
I want to add security roles manually through code.
I tried following:
RoleController objRoles = new RoleController();
RoleInfo objRole = new RoleInfo();
ArrayList alRoles = objRoles.GetPortalRoles(PortalId);
I got the list for all roles with manually added in arralylist and this way i create the user like -
objUserInfo.Roles = arrRoles;
UserController.CreateUser(ref objUserInfo);
User is created but role is not assogned to it. If i set Admin - Security Roles - Edit role and Click on "Auto" (like public), it works.
Now my problem is if I add two security roles, one with non auto, role is not assigned to that user.
Role is only assigned when auto is checked for that role.
If I set auto for both roles added then both roles are added to same single user. This i dont want.
So can any one tell me how to add security role manually through code.
[Note: I am using 4.9 version of dnn]
Waiting for reply. thanks in advance.