Пример #1
0
 static void Main(string[] args)
 {
     GenericIdentity identity = new GenericIdentity("Jorge");
     GenericPrincipal principal = new GenericPrincipal(identity, new string[] { "Guest", "Admin" });
     Thread.CurrentPrincipal = principal;
     RestricedLayer rl = new RestricedLayer();
     rl.GuestAccess();
     rl.AdminAccess();
     Console.ReadLine();
 }
Пример #2
0
        static void Main(string[] args)
        {
            GenericIdentity gid = new GenericIdentity("Pinku");
            GenericPrincipal gp = new GenericPrincipal(gid, new string[] { "Guest" });
            Thread.CurrentPrincipal = gp;

            RestricedLayer rl = new RestricedLayer();
            rl.GuestAccess();
            rl.AdminAccess();

            Console.ReadLine();
        }