• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Principal.IdentityReference类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Security.Principal.IdentityReference的典型用法代码示例。如果您正苦于以下问题:C# IdentityReference类的具体用法?C# IdentityReference怎么用?C# IdentityReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IdentityReference类属于System.Security.Principal命名空间,在下文中一共展示了IdentityReference类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AuthorizationRule

 protected internal AuthorizationRule(System.Security.Principal.IdentityReference identity, int accessMask, bool isInherited, System.Security.AccessControl.InheritanceFlags inheritanceFlags, System.Security.AccessControl.PropagationFlags propagationFlags)
 {
     if (identity == null)
     {
         throw new ArgumentNullException("identity");
     }
     if (accessMask == 0)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_ArgumentZero"), "accessMask");
     }
     if ((inheritanceFlags < System.Security.AccessControl.InheritanceFlags.None) || (inheritanceFlags > (System.Security.AccessControl.InheritanceFlags.ObjectInherit | System.Security.AccessControl.InheritanceFlags.ContainerInherit)))
     {
         throw new ArgumentOutOfRangeException("inheritanceFlags", Environment.GetResourceString("Argument_InvalidEnumValue", new object[] { inheritanceFlags, "InheritanceFlags" }));
     }
     if ((propagationFlags < System.Security.AccessControl.PropagationFlags.None) || (propagationFlags > (System.Security.AccessControl.PropagationFlags.InheritOnly | System.Security.AccessControl.PropagationFlags.NoPropagateInherit)))
     {
         throw new ArgumentOutOfRangeException("propagationFlags", Environment.GetResourceString("Argument_InvalidEnumValue", new object[] { inheritanceFlags, "PropagationFlags" }));
     }
     if (!identity.IsValidTargetType(typeof(SecurityIdentifier)))
     {
         throw new ArgumentException(Environment.GetResourceString("Arg_MustBeIdentityReferenceType"), "identity");
     }
     this._identity = identity;
     this._accessMask = accessMask;
     this._isInherited = isInherited;
     this._inheritanceFlags = inheritanceFlags;
     if (inheritanceFlags != System.Security.AccessControl.InheritanceFlags.None)
     {
         this._propagationFlags = propagationFlags;
     }
     else
     {
         this._propagationFlags = System.Security.AccessControl.PropagationFlags.None;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:35,代码来源:AuthorizationRule.cs


示例2: AccessRuleFactory

		public override AccessRule AccessRuleFactory (IdentityReference identityReference,
							      int accessMask, bool isInherited,
							      InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags,
							      AccessControlType type)
		{
			return new PipeAccessRule (identityReference, (PipeAccessRights)accessMask, type);
		}
开发者ID:nicolas-raoul,项目名称:mono,代码行数:7,代码来源:PipeSecurity.cs


示例3: MutexAuditRule

		public MutexAuditRule (IdentityReference identity,
				       MutexRights eventRights,
				       AuditFlags flags)
			: base (identity, 0, false, InheritanceFlags.None, PropagationFlags.None, flags)
		{
			this.rights = eventRights;
		}
开发者ID:runefs,项目名称:Marvin,代码行数:7,代码来源:MutexAuditRule.cs


示例4: AccessRuleFactory

		public override sealed AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask,
								     bool isInherited, InheritanceFlags inheritanceFlags,
								     PropagationFlags propagationFlags, AccessControlType type)
		{
			return new FileSystemAccessRule (identityReference, (FileSystemRights) accessMask, isInherited,
							 inheritanceFlags, propagationFlags, type);
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:7,代码来源:FileSystemSecurity.cs


示例5: AddAclRuleOnDirectory

 private static void AddAclRuleOnDirectory(string directory, IdentityReference identity, FileSystemRights rights, AccessControlType type)
 {
     var acl = Directory.GetAccessControl(directory);
     acl.PurgeAccessRules(identity);
     acl.AddAccessRule(new FileSystemAccessRule(identity, rights, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, type));
     Directory.SetAccessControl(directory, acl);
 }
开发者ID:vviskari,项目名称:MPExtended,代码行数:7,代码来源:EnvironmentChecks.cs


示例6: AddAclRuleOnFile

 private static void AddAclRuleOnFile(string file, IdentityReference identity, FileSystemRights rights, AccessControlType type)
 {
     var acl = File.GetAccessControl(file);
     acl.PurgeAccessRules(identity);
     acl.AddAccessRule(new FileSystemAccessRule(identity, rights, type));
     File.SetAccessControl(file, acl);
 }
开发者ID:vviskari,项目名称:MPExtended,代码行数:7,代码来源:EnvironmentChecks.cs


示例7: SemaphoreAccessRule

		public SemaphoreAccessRule (IdentityReference identity,
					    SemaphoreRights semaphoreRights,
					    AccessControlType type)
			: base (identity, 0, false, InheritanceFlags.None, PropagationFlags.None, type)
		{
			this.semaphoreRights = semaphoreRights;
		}
开发者ID:carrie901,项目名称:mono,代码行数:7,代码来源:SemaphoreAccessRule.cs


示例8: EventWaitHandleAuditRule

		public EventWaitHandleAuditRule (IdentityReference identity,
						 EventWaitHandleRights eventRights,
						 AuditFlags flags)
			: base (identity, 0, false, InheritanceFlags.None, PropagationFlags.None, flags)
		{
			if (eventRights < EventWaitHandleRights.Modify ||
			    eventRights > EventWaitHandleRights.FullControl) {
				throw new ArgumentOutOfRangeException ("eventRights");
			}
			if (flags < AuditFlags.None ||
			    flags > AuditFlags.Failure) {
				throw new ArgumentOutOfRangeException ("flags");
			}
			if (identity == null) {
				throw new ArgumentNullException ("identity");
			}
			if (eventRights == 0) {
				throw new ArgumentNullException ("eventRights");
			}
			if (flags == AuditFlags.None) {
				throw new ArgumentException ("flags");
			}
			if (!(identity is SecurityIdentifier)) {
				throw new ArgumentException ("identity");
			}
			
			this.rights = eventRights;
		}
开发者ID:runefs,项目名称:Marvin,代码行数:28,代码来源:EventWaitHandleAuditRule.cs


示例9: AuditRuleFactory

		public virtual AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask,
							   bool isInherited, InheritanceFlags inheritanceFlags,
							   PropagationFlags propagationFlags, AuditFlags flags,
							   Guid objectType, Guid inheritedObjectType)
		{
			throw GetNotImplementedException ();
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:7,代码来源:DirectoryObjectSecurity.cs


示例10: AuditRuleFactory

		public override sealed AuditRule AuditRuleFactory (IdentityReference identityReference,
								   int accessMask, bool isInherited,
								   InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags,
								   AuditFlags flags)
		{
			return new PipeAuditRule (identityReference, (PipeAccessRights)accessMask, flags);
		}
开发者ID:nicolas-raoul,项目名称:mono,代码行数:7,代码来源:PipeSecurity.cs


示例11: AccessRule

		protected AccessRule (IdentityReference identity,
				      int accessMask,
				      bool isInherited,
				      InheritanceFlags inheritanceFlags,
				      PropagationFlags propagationFlags,
				      AccessControlType type)
			: base (identity, accessMask, isInherited,
				inheritanceFlags, propagationFlags)
		{
			if (!(identity is SecurityIdentifier)) {
				throw new ArgumentException ("identity");
			}
			if (type < AccessControlType.Allow ||
			    type > AccessControlType.Deny) {
				throw new ArgumentException ("type");
			}
			
			
			if (accessMask == 0) {
				/* FIXME: check inheritance and
				 * propagation flags too
				 */
				throw new ArgumentOutOfRangeException ();
			}
		
			this.type = type;
		}
开发者ID:runefs,项目名称:Marvin,代码行数:27,代码来源:AccessRule.cs


示例12: WaitableTimerAccessRule

 public WaitableTimerAccessRule(
     IdentityReference identity,
     WaitableTimerRights timerRights,
     AccessControlType type)
     : this(identity, (int)timerRights, false, InheritanceFlags.None, PropagationFlags.None, type)
 {
 }
开发者ID:alberthoekstra,项目名称:PVBeanCounter,代码行数:7,代码来源:WaitableTimerSecurity.cs


示例13: SemaphoreAuditRule

		public SemaphoreAuditRule (IdentityReference identity,
					   SemaphoreRights semaphoreRights,
					   AuditFlags flags)
			: base (identity, 0, false, InheritanceFlags.None, PropagationFlags.None, flags)
		{
			this.semaphoreRights = semaphoreRights;
		}
开发者ID:carrie901,项目名称:mono,代码行数:7,代码来源:SemaphoreAuditRule.cs


示例14: EventWaitHandleAccessRule

		public EventWaitHandleAccessRule (IdentityReference identity,
						  EventWaitHandleRights eventRights,
						  AccessControlType type)
			: base (identity, (int)eventRights, false,
				InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow)
		{
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:7,代码来源:EventWaitHandleAccessRule.cs


示例15: ShowDialog

        /// <summary>
        /// Displays the dialog.
        /// </summary>
        public bool ShowDialog(ApplicationAccessRule accessRule)
        {
            AccessTypeCB.SelectedItem = accessRule.RuleType;
            IdentityNameTB.Text = accessRule.IdentityName;
            m_identity = accessRule.IdentityReference;

            if (m_identity == null)
            {
                AccountInfo account = AccountInfo.Create(IdentityNameTB.Text);

                if (account != null)
                {
                    m_identity = account.GetIdentityReference();
                }
            }

            if (accessRule.Right != ApplicationAccessRight.None)
            {
                AccessRightCB.SelectedItem = accessRule.Right;
            }

            if (ShowDialog() != DialogResult.OK)
            {
                return false;
            }
                    
            accessRule.RuleType = (AccessControlType)AccessTypeCB.SelectedItem;
            accessRule.Right = (ApplicationAccessRight)AccessRightCB.SelectedItem;
            accessRule.IdentityReference = m_identity;

            return true;
        }
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:35,代码来源:AccessRuleDlg.cs


示例16: MutexAccessRule

		public MutexAccessRule (IdentityReference identity,
					MutexRights eventRights,
					AccessControlType type)
			: base (identity, (int)eventRights, false, InheritanceFlags.None, PropagationFlags.None, type)
		{

		}
开发者ID:carrie901,项目名称:mono,代码行数:7,代码来源:MutexAccessRule.cs


示例17: AuthorizationRule

		protected internal AuthorizationRule (IdentityReference identity,
						      int accessMask, bool isInherited,
						      InheritanceFlags inheritanceFlags,
						      PropagationFlags propagationFlags)
		{
			if (!(identity is SecurityIdentifier) && !(identity is NTAccount))
				throw new ArgumentException ("identity");

			// Unit testing showed that MS.NET 4.0 actually throws ArgumentException
			// for accessMask == 0, not the ArgumentOutOfRangeException specified.			
			if (accessMask == 0)
				throw new ArgumentException ("accessMask");

			if (0 != (inheritanceFlags & ~(InheritanceFlags.ContainerInherit|InheritanceFlags.ObjectInherit)))
				throw new ArgumentOutOfRangeException ();

			if (0 != (propagationFlags & ~(PropagationFlags.NoPropagateInherit|PropagationFlags.InheritOnly)))
				throw new ArgumentOutOfRangeException ();
			
			this.identity = identity;
			this.accessMask = accessMask;
			this.isInherited = isInherited;
			this.inheritanceFlags = inheritanceFlags;
			this.propagationFlags = propagationFlags;
		}
开发者ID:carrie901,项目名称:mono,代码行数:25,代码来源:AuthorizationRule.cs


示例18: CryptoKeyAuditRule

		public CryptoKeyAuditRule (IdentityReference identity,
					   CryptoKeyRights cryptoKeyRights,
					   AuditFlags flags)
			: base (identity, 0, false, InheritanceFlags.None, PropagationFlags.None, flags)
		{
			this.rights = cryptoKeyRights;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:CryptoKeyAuditRule.cs


示例19: CryptoKeyAccessRule

		public CryptoKeyAccessRule (IdentityReference identity,
					    CryptoKeyRights cryptoKeyRights,
					    AccessControlType type)
			: base (identity, (int)cryptoKeyRights, false,
				InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow)
		{
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:7,代码来源:CryptoKeyAccessRule.cs


示例20: WaitableTimerAuditRule

 public WaitableTimerAuditRule(
     IdentityReference identity,
     WaitableTimerRights timerRights,
     AuditFlags flags)
     : this(identity, (int)timerRights, false, InheritanceFlags.None, PropagationFlags.None, flags)
 {
 }
开发者ID:alberthoekstra,项目名称:PVBeanCounter,代码行数:7,代码来源:WaitableTimerSecurity.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Principal.NTAccount类代码示例发布时间:2022-05-26
下一篇:
C# Principal.GenericPrincipal类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap