RoleController.GetRoleGroups(portalid); is giving only user created group not Global Roles Group that is created by default.
You can use RoleController.GetRoleGroups()
for this :-
var arrGroups = RoleController.GetRoleGroups(portalSettings.PortalId);
foreach (RoleGroupInfo roleGroup in arrGroups)
{
//Your Logic goes here :-
}
You can use RoleController.GetRoles()
for this :-
There are two overload of this method :-
IList<RoleInfo> GetRoles(int portalId, Func<RoleInfo, bool> predicate);
IList<RoleInfo> GetRoles(int portalId);
You can see the Source code here :-
This is how you can use the method :-
foreach (var role in TestableRoleController.Instance.GetRoles(portalId))
{
// you can Put your Logic here :-
}
The global role group is really the absence of a role group. So, the "global" group is roles with a group ID of -1
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With