Get the page user, the below code works fine for me;
System.Security.Principal.WindowsPrincipal pageUser = User as System.Security.Principal.WindowsPrincipal;
Check if the User is in a specific security group;
if(pageUser.IsInRole(@"Domain\Security Group Name"))
{
}
else
{
}
Works for Domain or Local Machine accounts
Kind Regards