Hi,

The below code is for determine whether the current principal/user belongs to the Windows user group with the specified name.

WindowsPrincipal myPrincipal = new WindowsPrincipal(ServiceSecurityContext.Current.WindowsIdentity);

if(myPrincipal.IsInRole(@"Windows user group"))
{
    //authorized
}
else
{
   //not authorized
}

For machine-specific roles, the role string should be in the form "MachineName\RoleNameHere".
For domain-specific roles, the role string should be in the form "DomainName\RoleNameHere"
for example, "SomeDomain\Domain Users".