当前位置: 首页>>代码示例>>C#>>正文


C# PrincipalPermission.IsSubsetOf方法代码示例

本文整理汇总了C#中System.Security.Permissions.PrincipalPermission.IsSubsetOf方法的典型用法代码示例。如果您正苦于以下问题:C# PrincipalPermission.IsSubsetOf方法的具体用法?C# PrincipalPermission.IsSubsetOf怎么用?C# PrincipalPermission.IsSubsetOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Security.Permissions.PrincipalPermission的用法示例。


在下文中一共展示了PrincipalPermission.IsSubsetOf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsSubsetOfBadPermission

		public void IsSubsetOfBadPermission () 
		{
			PrincipalPermission p1 = new PrincipalPermission ("user", null);
			EnvironmentPermission ep2 = new EnvironmentPermission (PermissionState.Unrestricted);
			Assert ("IsSubsetOf(EnvironmentPermission)", p1.IsSubsetOf (ep2));
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:6,代码来源:PrincipalPermissionTest.cs

示例2: IsSubsetOf

		public void IsSubsetOf () 
		{
			PrincipalPermission p1 = new PrincipalPermission ("user A", "role 1");
			PrincipalPermission p2 = new PrincipalPermission (null, "role 1");
			Assert ("UserRole.IsSubsetOf(Role)", p1.IsSubsetOf (p2));
			Assert ("Role.IsSubsetOf(UserRole)", !p2.IsSubsetOf (p1));

			PrincipalPermission p3 = new PrincipalPermission ("user A", "role 1", false);
			Assert ("UserRoleAuth.IsSubsetOf(UserRoleNA)", !p3.IsSubsetOf (p1));
			Assert ("UserRoleNA.IsSubsetOf(UserRoleAuth)", !p1.IsSubsetOf (p3));

			PrincipalPermission p4 = new PrincipalPermission (null, null, true); // unrestricted
			Assert ("unrestricted.IsSubsetOf(UserRole)", !p4.IsSubsetOf (p1));
			Assert ("UserRole.IsSubsetOf(unrestricted)", p1.IsSubsetOf (p4));
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:15,代码来源:PrincipalPermissionTest.cs

示例3: IsSubsetOfNull

		public void IsSubsetOfNull () 
		{
			PrincipalPermission p = new PrincipalPermission ("user", null);
			Assert ("User.IsSubsetOf(null)", !p.IsSubsetOf (null));
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:5,代码来源:PrincipalPermissionTest.cs

示例4: IsSubsetOfUnrestricted

		public void IsSubsetOfUnrestricted () 
		{
			PrincipalPermission p1 = new PrincipalPermission (PermissionState.Unrestricted);
			PrincipalPermission p2 = new PrincipalPermission ("user", "role", false);
			Assert ("Unrestricted.IsSubsetOf(user)", !p1.IsSubsetOf (p2));
			Assert ("user.IsSubsetOf(Unrestricted)", p2.IsSubsetOf (p1));
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:PrincipalPermissionTest.cs

示例5: IsSubsetOfNone

		public void IsSubsetOfNone ()
		{
			PrincipalPermission none = new PrincipalPermission (PermissionState.None);
			PrincipalPermission p = new PrincipalPermission ("user", null);
			Assert.IsTrue (!p.IsSubsetOf (none), "User.IsSubsetOf(null)");

			p = new PrincipalPermission (PermissionState.None);
			Assert.IsTrue (p.IsSubsetOf (none), "None.IsSubsetOf(null)");

			p = new PrincipalPermission (PermissionState.Unrestricted);
			Assert.IsTrue (!p.IsSubsetOf (none), "Unrestricted.IsSubsetOf(null)");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:12,代码来源:PrincipalPermissionTest.cs


注:本文中的System.Security.Permissions.PrincipalPermission.IsSubsetOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。