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

C# AccessControlType类代码示例

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

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



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

示例1: 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


示例2: 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


示例3: AddAccess

 public void AddAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
 {
     base.CheckAccessType(accessType);
     base.CheckFlags(inheritanceFlags, propagationFlags);
     this.everyOneFullAccessForNullDacl = false;
     base.AddQualifiedAce(sid, (accessType == AccessControlType.Allow) ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), ObjectAceFlags.None, Guid.Empty, Guid.Empty);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:DiscretionaryAcl.cs


示例4: SemaphoreAccessRule

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


示例5: AddFileSecurity

        public static void AddFileSecurity(string fileName, string WindowsAccount, FileSystemRights rights, AccessControlType accessControlType)
        {
            FileSecurity fSecurity = File.GetAccessControl(fileName);
            fSecurity.AddAccessRule(new FileSystemAccessRule(WindowsAccount, rights, accessControlType));
            File.SetAccessControl(fileName, fSecurity);

        }
开发者ID:alexndrejoly,项目名称:csharpmlib,代码行数:7,代码来源:Security.cs


示例6: AccessRuleFactory

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


示例7: base

	public FileSystemAccessRule
				(String identity, FileSystemRights fileSystemRights,
				 InheritanceFlags inheritanceFlags,
				 PropagationFlags propagationFlags, AccessControlType type)
			: base(IdentityReference.IdentityFromName(identity),
				   (int)fileSystemRights, false, inheritanceFlags,
				   propagationFlags, type) {}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:FileSystemAccessRule.cs


示例8: 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


示例9: 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


示例10: 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


示例11: TestAddAccess

        private static bool TestAddAccess(DiscretionaryAcl discretionaryAcl, RawAcl rawAcl, AccessControlType accessControlType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
        {
            bool result = true;
            byte[] dAclBinaryForm = null;
            byte[] rAclBinaryForm = null;

            discretionaryAcl.AddAccess(accessControlType, sid, accessMask, inheritanceFlags, propagationFlags);
            if (discretionaryAcl.Count == rawAcl.Count &&
                discretionaryAcl.BinaryLength == rawAcl.BinaryLength)
            {

                dAclBinaryForm = new byte[discretionaryAcl.BinaryLength];
                rAclBinaryForm = new byte[rawAcl.BinaryLength];
                discretionaryAcl.GetBinaryForm(dAclBinaryForm, 0);
                rawAcl.GetBinaryForm(rAclBinaryForm, 0);
                if (!Utils.IsBinaryFormEqual(dAclBinaryForm, rAclBinaryForm))
                    result = false;

                //redundant index check

                for (int i = 0; i < discretionaryAcl.Count; i++)
                {
                    if (!Utils.IsAceEqual(discretionaryAcl[i], rawAcl[i]))
                    {

                        result = false;
                        break;
                    }
                }
            }
            else
                result = false;

            return result;
        }
开发者ID:ChuangYang,项目名称:corefx,代码行数:35,代码来源:DiscretionaryAcl_AddAccess.cs


示例12: 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


示例13: base

	public RegistryAccessRule
				(String identity, RegistryRights registryRights,
				 InheritanceFlags inheritanceFlags,
				 PropagationFlags propagationFlags, AccessControlType type)
			: base(IdentityReference.IdentityFromName(identity),
				   (int)registryRights, false, inheritanceFlags,
				   propagationFlags, type) {}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:RegistryAccessRule.cs


示例14: 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


示例15: AddDirectorySecurity

		private static void AddDirectorySecurity(string folderName, string account, FileSystemRights rights, InheritanceFlags inheritance, PropagationFlags propogation, AccessControlType controlType)
		{
			DirectoryInfo directoryInfo = new DirectoryInfo(folderName);
			DirectorySecurity accessControl = directoryInfo.GetAccessControl();
			accessControl.AddAccessRule(new FileSystemAccessRule(account, rights, inheritance, propogation, controlType));
			directoryInfo.SetAccessControl(accessControl);
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:InstanceStorePermission.cs


示例16: 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


示例17: 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


示例18: base

	public EventWaitHandleAccessRule
				(String identity,
				 EventWaitHandleRights eventRights,
				 AccessControlType type)
			: base(IdentityReference.IdentityFromName(identity),
				   (int)eventRights, false, InheritanceFlags.None,
				   PropagationFlags.None, type) {}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:EventWaitHandleAccessRule.cs


示例19: FileSystemAccessRule

		public FileSystemAccessRule (string identity,
					     FileSystemRights fileSystemRights,
					     InheritanceFlags inheritanceFlags,
					     PropagationFlags propagationFlags,
					     AccessControlType type)
			: this (new NTAccount (identity), fileSystemRights, inheritanceFlags, propagationFlags, type)
		{
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:8,代码来源:FileSystemAccessRule.cs


示例20: CryptoKeyAccessRule

 public CryptoKeyAccessRule (string identity, CryptoKeyRights cryptoKeyRights, AccessControlType type)
             : this (new NTAccount(identity),
                     AccessMaskFromRights(cryptoKeyRights, type),
                     false,
                     InheritanceFlags.None,
                     PropagationFlags.None,
                     type) {
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:CryptoKeySecurity.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# AccessHelper类代码示例发布时间:2022-05-24
下一篇:
C# AccessControlSections类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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