So I am using this if statement to check if a user is of a specific role:
if (CMS.CMSHelper.CMSContext.CurrentUser.IsInRole("ServiceRep", CMS.CMSHelper.CMSContext.CurrentSite.SiteName))
{
//do stuff
}
ServiceRep is a custom role I created. When I test this with a user that is of this role, I get a false. I made sure the role was added to the user. When I use this to check all of the users roles
var roles = CMS.SiteProvider.UserInfoProvider.GetUserRoles(CMS.CMSHelper.CMSContext.CurrentUser);
if (roles != null)
{
foreach (var role in roles.Rows)
{
}
}
The the only roles that show up are Everyone and unauthenticated.