A declarative role-based security demand for the current principal
using System;
using System.Security.Permissions;
class MainClass
{
[PrincipalPermission(SecurityAction.Demand, Name = @"MACHINE\Joe", Role = @"MACHINE\Managers")]
public static void MyMethod()
{
}
}