3 using System.Security.Permissions;
4 using System.Security.Principal;
5 using System.Threading;
7 [PrincipalPermission (SecurityAction.LinkDemand, Authenticated=false)]
8 public class LinkDemand {
10 static public int Test ()
12 Console.WriteLine ("*0* [this should print]");
17 class LinkDemandTest {
21 GenericIdentity identity = new GenericIdentity ("me");
22 string[] roles = new string [1] { "mono hacker" };
23 Thread.CurrentPrincipal = new GenericPrincipal (identity, roles);
25 return LinkDemand.Test ();
29 static int Main (string[] args)
34 catch (SecurityException se) {
35 Console.WriteLine ("*1* Unexpected SecurityException\n{0}", se);
39 Console.WriteLine ("*2* Unexpected Exception\n{0}", e);