CreatePermission() public method

public CreatePermission ( ) : IPermission
return IPermission
		public void Default () 
		{
			EnvironmentPermissionAttribute a = new EnvironmentPermissionAttribute (SecurityAction.Assert);
			Assert.IsNull (a.Read, "Read");
			Assert.IsNull (a.Write, "Write");
			Assert.AreEqual (a.ToString (), a.TypeId.ToString (), "TypeId");
			Assert.IsFalse (a.Unrestricted, "Unrestricted");

			EnvironmentPermission p = (EnvironmentPermission) a.CreatePermission ();
			Assert.AreEqual (String.Empty, p.GetPathList (EnvironmentPermissionAccess.Read), "GetPathList(Read)");
			Assert.AreEqual (String.Empty, p.GetPathList (EnvironmentPermissionAccess.Write), "GetPathList(Write)");
			Assert.IsFalse (p.IsUnrestricted (), "CreatePermission-IsUnrestricted");
		}
		public void All () 
		{
			EnvironmentPermissionAttribute attr = new EnvironmentPermissionAttribute (SecurityAction.Assert);
			attr.All = envar;
			Assert.AreEqual (envar, attr.Read, "All=Read");
			Assert.AreEqual (envar, attr.Write, "All=Write");
			EnvironmentPermission p = (EnvironmentPermission) attr.CreatePermission ();
			Assert.AreEqual (envar, p.GetPathList (EnvironmentPermissionAccess.Read), "All=EnvironmentPermission-Read");
			Assert.AreEqual (envar, p.GetPathList (EnvironmentPermissionAccess.Write), "All=EnvironmentPermission-Write");
		}
		public void Unrestricted () 
		{
			EnvironmentPermissionAttribute a = new EnvironmentPermissionAttribute (SecurityAction.Assert);
			a.Unrestricted = true;

			EnvironmentPermission perm = (EnvironmentPermission) a.CreatePermission ();
			Assert.IsTrue (perm.IsUnrestricted (), "CreatePermission.IsUnrestricted");
			Assert.AreEqual (String.Empty, perm.GetPathList (EnvironmentPermissionAccess.Read), "GetPathList(Read)");
			Assert.AreEqual (String.Empty, perm.GetPathList (EnvironmentPermissionAccess.Write), "GetPathList(Write)");
		}
		public void Write ()
		{
			EnvironmentPermissionAttribute attr = new EnvironmentPermissionAttribute (SecurityAction.Assert);
			attr.Write = envar;
			Assert.IsNull (attr.Read, "Read=null");
			Assert.AreEqual (envar, attr.Write, "Write=Write");
			EnvironmentPermission p = (EnvironmentPermission) attr.CreatePermission ();
#if NET_2_0
			Assert.AreEqual (String.Empty, p.GetPathList (EnvironmentPermissionAccess.Read), "Write=EnvironmentPermission-Read");
#else
			Assert.IsNull (p.GetPathList (EnvironmentPermissionAccess.Read), "Write=EnvironmentPermission-Read");
#endif
			Assert.AreEqual (envar, p.GetPathList (EnvironmentPermissionAccess.Write), "Write=EnvironmentPermission-Write");
		}