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

C# ObjectAceFlags类代码示例

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

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



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

示例1: RemoveAuditSpecific

 public void RemoveAuditSpecific(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
 {
     if (!base.IsDS)
     {
         throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_OnlyValidForDS"));
     }
     base.RemoveQualifiedAcesSpecific(sid, AceQualifier.SystemAudit, accessMask, (AceFlags) ((byte) (GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags))), objectFlags, objectType, inheritedObjectType);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:SystemAcl.cs


示例2: AddAudit

	public void AddAudit(AuditFlags auditFlags, SecurityIdentifier sid,
						 int accessMask, InheritanceFlags inheritanceFlags,
						 PropagationFlags propagationFlags,
						 ObjectAceFlags objectFlags, Guid objectType,
						 Guid inheritedObjectType)
			{
				// TODO
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:SystemAcl.cs


示例3: AddAccess

	public void AddAccess(AccessControlType accessType, SecurityIdentifier sid,
						  int accessMask, InheritanceFlags inheritanceFlags,
						  PropagationFlags propagationFlags,
						  ObjectAceFlags objectFlags, Guid objectType,
						  Guid inheritedObjectType)
			{
				// TODO
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:DiscretionaryAcl.cs


示例4: RemoveAudit

	public bool RemoveAudit(AuditFlags auditFlags, SecurityIdentifier sid,
						    int accessMask, InheritanceFlags inheritanceFlags,
						    PropagationFlags propagationFlags,
						    ObjectAceFlags objectFlags, Guid objectType,
						    Guid inheritedObjectType)
			{
				// TODO
				return false;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:9,代码来源:SystemAcl.cs


示例5: RemoveAccessSpecific

 public void RemoveAccessSpecific(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
 {
     if (!base.IsDS)
     {
         throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_OnlyValidForDS"));
     }
     base.CheckAccessType(accessType);
     this.everyOneFullAccessForNullDacl = false;
     base.RemoveQualifiedAcesSpecific(sid, (accessType == AccessControlType.Allow) ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), objectFlags, objectType, inheritedObjectType);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:DiscretionaryAcl.cs


示例6: ObjectAce

		internal ObjectAce (AceType type, AceFlags flags, int accessMask,
		                    SecurityIdentifier sid, ObjectAceFlags objFlags,
		                    Guid objType, Guid inheritedType, byte[] opaque)
			: base(type, flags, opaque)
		{
			AccessMask = accessMask;
			SecurityIdentifier = sid;
			ObjectAceFlags = objFlags;
			ObjectAceType = objType;
			InheritedObjectAceType = inheritedType;
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:11,代码来源:ObjectAce.cs


示例7: RemoveAccess

		public bool RemoveAccess (AccessControlType accessType,
					  SecurityIdentifier sid,
					  int accessMask,
					  InheritanceFlags inheritanceFlags,
					  PropagationFlags propagationFlags,
					  ObjectAceFlags objectFlags,
					  Guid objectType,
					  Guid inheritedObjectType)
		{
			throw new NotImplementedException ();
		}
开发者ID:adbre,项目名称:mono,代码行数:11,代码来源:DiscretionaryAcl.cs


示例8: AddAudit

		public void AddAudit (AuditFlags auditFlags,
				      SecurityIdentifier sid, int accessMask,
				      InheritanceFlags inheritanceFlags,
				      PropagationFlags propagationFlags,
				      ObjectAceFlags objectFlags,
				      Guid objectType,
				      Guid inheritedObjectType)
		{
			// ObjectAce?
			throw new NotImplementedException ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:11,代码来源:SystemAcl.cs


示例9: AddAudit

		public void AddAudit (AuditFlags auditFlags,
				      SecurityIdentifier sid, int accessMask,
				      InheritanceFlags inheritanceFlags,
				      PropagationFlags propagationFlags,
				      ObjectAceFlags objectFlags,
				      Guid objectType,
				      Guid inheritedObjectType)
		{
			AddAce (AceQualifier.SystemAudit, sid, accessMask,
				inheritanceFlags, propagationFlags, auditFlags,
				objectFlags, objectType, inheritedObjectType);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:12,代码来源:SystemAcl.cs


示例10: AddAccess

		public void AddAccess (AccessControlType accessType,
				       SecurityIdentifier sid, int accessMask,
				       InheritanceFlags inheritanceFlags,
				       PropagationFlags propagationFlags,
				       ObjectAceFlags objectFlags,
				       Guid objectType,
				       Guid inheritedObjectType)
		{
			AddAce (GetAceQualifier (accessType), sid, accessMask,
				inheritanceFlags, propagationFlags, AuditFlags.None,
				objectFlags, objectType, inheritedObjectType);
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:12,代码来源:DiscretionaryAcl.cs


示例11: VerifyObjectAce

 protected static void VerifyObjectAce(ObjectAce ace, AceFlags aceFlags, AceQualifier qualifier, int accessMask, SecurityIdentifier sid, ObjectAceFlags flags, Guid type, Guid inheritedType, bool isCallback, byte[] opaque)
 {
     Assert.Equal(aceFlags, ace.AceFlags);
     Assert.Equal(accessMask, ace.AccessMask);
     Assert.Equal(sid, ace.SecurityIdentifier);
     Assert.Equal(opaque, ace.GetOpaque());
     Assert.Equal(qualifier, ace.AceQualifier);
     Assert.Equal(isCallback, ace.IsCallback);
     Assert.Equal(flags, ace.ObjectAceFlags);
     Assert.Equal(type, ace.ObjectAceType);
     Assert.Equal(inheritedType, ace.InheritedObjectAceType);
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:12,代码来源:Ace.Object.Tests.cs


示例12: ObjectAce

		public ObjectAce (AceFlags aceFlags, AceQualifier qualifier,
				  int accessMask, SecurityIdentifier sid,
				  ObjectAceFlags flags, Guid type,
				  Guid inheritedType, bool isCallback,
				  byte[] opaque)
			: base (InheritanceFlags.None, PropagationFlags.None, qualifier, isCallback, opaque)
		{
			AceFlags = aceFlags;
			SecurityIdentifier = sid;
			object_ace_flags = flags;
			object_ace_type = type;
			inherited_object_type = inheritedType;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:13,代码来源:ObjectAce.cs


示例13: ObjectAccessRule

 protected ObjectAccessRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid objectType, Guid inheritedObjectType, AccessControlType type) : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, type)
 {
     if (!objectType.Equals(Guid.Empty) && ((accessMask & ObjectAce.AccessMaskWithObjectType) != 0))
     {
         this._objectType = objectType;
         this._objectFlags |= ObjectAceFlags.ObjectAceTypePresent;
     }
     else
     {
         this._objectType = Guid.Empty;
     }
     if (!inheritedObjectType.Equals(Guid.Empty) && ((inheritanceFlags & InheritanceFlags.ContainerInherit) != InheritanceFlags.None))
     {
         this._inheritedObjectType = inheritedObjectType;
         this._objectFlags |= ObjectAceFlags.InheritedObjectAceTypePresent;
     }
     else
     {
         this._inheritedObjectType = Guid.Empty;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:21,代码来源:ObjectAccessRule.cs


示例14: RemoveAuditSpecific

        public void RemoveAuditSpecific( AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType )
        {
            //
            // This is valid only for DS Acls 
            //
            if ( !IsDS )
            {
                throw new InvalidOperationException(
                    Environment.GetResourceString( "InvalidOperation_OnlyValidForDS" ));
            }
            Contract.EndContractBlock();

            RemoveQualifiedAcesSpecific(sid, AceQualifier.SystemAudit, accessMask, GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), objectFlags, objectType, inheritedObjectType);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:14,代码来源:ACL.cs


示例15: RemoveQualifiedAcesSpecific

        internal void RemoveQualifiedAcesSpecific( SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType )
        {
            if ( accessMask == 0 )
            {
                throw new ArgumentException(
                    Environment.GetResourceString( "Argument_ArgumentZero" ),
                    "accessMask" );
            }

            if ( qualifier == AceQualifier.SystemAudit &&
                (( flags & AceFlags.AuditFlags ) == 0 ))
            {
                throw new ArgumentException(
                    Environment.GetResourceString( "Arg_EnumAtLeastOneFlag" ),
                    "flags" );
            }
        
            if ( sid == null )
            {
                throw new ArgumentNullException( "sid" );
            }
            Contract.EndContractBlock();
            ThrowIfNotCanonical();

            for ( int i = 0; i < Count; i++ )
            {
                QualifiedAce ace = _acl[i] as QualifiedAce;

                //
                // Not a qualified ACE - keep going
                //

                if ( ace == null )
                {
                    continue;
                }

                //
                // Only interested in explicit (non-inherited) ACEs
                //

                if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
                {
                    continue;
                }

                //
                // Only interested in ACEs with the specified qualifier
                //

                if ( ace.AceQualifier != qualifier )
                {
                    continue;
                }

                //
                // Only interested in ACEs with the specified SID
                //

                if ( ace.SecurityIdentifier != sid )
                {
                    continue;
                }

                //
                // Only interested in exact ACE flag matches
                //

                if ( ace.AceFlags != flags )
                {
                    continue;
                }

                //
                // Only interested in exact access mask matches
                //

                if ( ace.AccessMask != accessMask )
                {
                    continue;
                }

                if ( IsDS ) 
                {
                    //
                    // Incase of object aces, only interested in ACEs which match in their 
                    // objectType and inheritedObjectType
                    //

                    if (( ace is ObjectAce ) && ( objectFlags != ObjectAceFlags.None ))
                    {                 
                        //
                        // both are object aces, so must match in object type and inherited object type
                        //
                        ObjectAce objectAce = ace as ObjectAce;
                        
                        if (( !objectAce.ObjectTypesMatch( objectFlags, objectType ))
                            || ( !objectAce.InheritedObjectTypesMatch( objectFlags, inheritedObjectType ))) 
                        {
                            continue;
//.........这里部分代码省略.........
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:101,代码来源:ACL.cs


示例16: RemoveQualifiedAces

        //
        // Helper function behind all the RemoveXXX methods
        //

        internal bool RemoveQualifiedAces( SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, bool saclSemantics, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType )
        {
            if ( accessMask == 0 )
            {
                throw new ArgumentException(
                    Environment.GetResourceString( "Argument_ArgumentZero" ),
                    "accessMask" );
            }

            if ( qualifier == AceQualifier.SystemAudit &&
                (( flags & AceFlags.AuditFlags ) == 0 ))
            {
                throw new ArgumentException(
                    Environment.GetResourceString( "Arg_EnumAtLeastOneFlag" ),
                    "flags" );
            }

            if ( sid == null )
            {
                throw new ArgumentNullException( "sid" );
            }
            Contract.EndContractBlock();
            ThrowIfNotCanonical();


            //
            // Two passes are made.
            // During the first pass, no changes are made to the ACL,
            // the ACEs are simply evaluated to ascertain that the operation
            // can succeed.
            // If everything is kosher, the second pass is the one that makes changes.
            //

            bool evaluationPass = true;
            bool removePossible = true; // unless proven otherwise
            
            //
            // Needed for DS acls to keep track of the original access mask specified for removal
            //
            int originalAccessMask = accessMask;
            AceFlags originalFlags = flags;

            //
            // It is possible that the removal will result in an overflow exception
            // because more ACEs get inserted.
            // Save the current state of the object and revert to it later if
            // and exception is thrown.
            //

            byte[] recovery = new byte[BinaryLength];
            GetBinaryForm( recovery, 0 );

        MakeAnotherPass:

            try
            {
                for ( int i = 0; i < Count; i++ )
                {
                    QualifiedAce ace = _acl[i] as QualifiedAce;

                    //
                    // Not a qualified ACE - keep going
                    //

                    if ( ace == null )
                    {
                        continue;
                    }

                    //
                    // Only interested in explicit (non-inherited) ACEs
                    //

                    if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
                    {
                        continue;
                    }

                    //
                    // Only interested in ACEs with the specified qualifier
                    //

                    if ( ace.AceQualifier != qualifier )
                    {
                        continue;
                    }

                    //
                    // Only interested in ACEs with the specified SID
                    //

                    if ( ace.SecurityIdentifier != sid )
                    {
                        continue;
                    }               

//.........这里部分代码省略.........
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:101,代码来源:ACL.cs


示例17: SetQualifiedAce

        //
        // Helper function behind all the SetXXX methods
        //

        internal void SetQualifiedAce( SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType )
        {
            if ( sid == null )
            {
                throw new ArgumentNullException( "sid" );
            }

            if ( qualifier == AceQualifier.SystemAudit &&
                (( flags & AceFlags.AuditFlags ) == 0 ))
            {
                throw new ArgumentException(
                    Environment.GetResourceString( "Arg_EnumAtLeastOneFlag" ),
                    "flags" );
            }

            if ( accessMask == 0 )
            {
                throw new ArgumentException(
                    Environment.GetResourceString( "Argument_ArgumentZero" ),
                    "accessMask" );
            }
            Contract.EndContractBlock();
            ThrowIfNotCanonical();

            GenericAce newAce;

            if (( !IsDS ) || ( objectFlags == ObjectAceFlags.None ))
            {
                newAce = new CommonAce( flags, qualifier, accessMask, sid, false, null );
            }
            else
            {
                newAce = new ObjectAce( flags, qualifier, accessMask, sid, objectFlags, objectType, inheritedObjectType, false, null );
            }

            //
            // Make sure the new ACE wouldn't be meaningless before proceeding
            //

            if ( false == InspectAce( ref newAce, ( this is DiscretionaryAcl )))
            {
                return;
            }

            for ( int i = 0; i < Count; i++ )
            {
                QualifiedAce ace = _acl[i] as QualifiedAce;

                //
                // Not a qualified ACE - keep going
                //

                if ( ace == null )
                {
                    continue;
                }

                //
                // Only interested in explicit (non-inherited) ACEs
                //

                if (( ace.AceFlags & AceFlags.Inherited ) != 0 )
                {
                    continue;
                }

                //
                // Only interested in ACEs with the specified qualifier
                //

                if ( ace.AceQualifier != qualifier )
                {
                    continue;
                }

                //
                // Only interested in ACEs with the specified SID
                //

                if ( ace.SecurityIdentifier != sid )
                {
                    continue;
                }

                //
                // This ACE corresponds to the SID and qualifier in question - remove it
                //

                _acl.RemoveAce( i );
                i--;
            }

            //
            // As a final step, add the ACE we want.
            // Add it at the end - we'll re-canonicalize later.
            //
//.........这里部分代码省略.........
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:101,代码来源:ACL.cs


示例18: AddQualifiedAce

        //
        // Helper function behind all the AddXXX methods for qualified aces
        //

        internal void AddQualifiedAce( SecurityIdentifier sid, AceQualifier qualifier, int accessMask, AceFlags flags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType )
        {
            if ( sid == null )
            {
                throw new ArgumentNullException( "sid" );
            }
            Contract.EndContractBlock();

            ThrowIfNotCanonical();

            bool aceMerged = false; // if still false after all attempts to merge, create new entry

            if ( qualifier == AceQualifier.SystemAudit &&
                (( flags & AceFlags.AuditFlags ) == 0 ))
            {
                throw new ArgumentException(
                    Environment.GetResourceString( "Arg_EnumAtLeastOneFlag" ),
                    "flags" );
            }

            if ( accessMask == 0 )
            {
                throw new ArgumentException(
                    Environment.GetResourceString( "Argument_ArgumentZero" ),
                    "accessMask" );
            }

            GenericAce newAce;

            if (( !IsDS ) || ( objectFlags == ObjectAceFlags.None ))
            {
                newAce = new CommonAce( flags, qualifier, accessMask, sid, false, null );
            }
            else
            {
                newAce = new ObjectAce( flags, qualifier, accessMask, sid, objectFlags, objectType, inheritedObjectType, false, null );
            }

            //
            // Make sure the new ACE wouldn't be meaningless before proceeding
            //

            if ( false == InspectAce( ref newAce, ( this is DiscretionaryAcl )))
            {
                return;
            }

            //
            // See if the new ACE can be merged with any of the existing ones
            //

            for ( int i = 0; i < Count; i++ )
            {
                QualifiedAce ace = _acl[i] as QualifiedAce;

                if ( ace == null )
                {
                    continue;
                }

                if ( true == MergeAces( ref ace, newAce as QualifiedAce ))
                {
                    aceMerged = true;
                    break;
                }
            }

            //
            // Couldn't modify any existing entry, so add a new one
            //

            if ( !aceMerged )
            {
                _acl.InsertAce( _acl.Count, newAce );

                _isDirty = true;
            }
            OnAclModificationTried();
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:83,代码来源:ACL.cs


示例19: GetInheritanceFlagsForRemoval

        private bool GetInheritanceFlagsForRemoval( QualifiedAce ace, ObjectAceFlags objectFlags, Guid inheritedObjectType, ref AceFlags aceFlags )
        {
            if ((( ace.AceFlags & AceFlags.ContainerInherit ) != 0 )  && (( aceFlags & AceFlags.ContainerInherit ) != 0 ))
            {

                // 
                // If the aces have inheritance bits in common 
                // then we follow these rules:
                //
                //       Remove    No IOT    IOT = A        IOT = B
                // Existing
                // 
                //   No IOT          Remove   Invalid        Invalid
                //
                //   IOT = A        Remove   Remove      Nothing Common
                //
            
                
                if ( ace is ObjectAce )
                {
                    bool commonInheritanceFlagsExist = true;
                    ObjectAce objectAce = ace as ObjectAce;

                    //
                    // if what we are trying to remove has an inherited object type 
                    // but the existing ace does not then this is an invalid case
                    //
                    if ((( objectFlags & ObjectAceFlags.InheritedObjectAceTypePresent ) != 0 ) && 
                        (( objectAce.ObjectAceFlags & ObjectAceFlags.InheritedObjectAceTypePresent ) == 0 ))
                    {
                        return false;
                    }

                    //
                    // if what we are trying to remove has no inherited object type or
                    // if inherited object types match then we have common inheritance flags                     
                    //
                    commonInheritanceFlagsExist = (( objectFlags & ObjectAceFlags.InheritedObjectAceTypePresent ) == 0 ) ||
                                                                       objectAce.InheritedObjectTypesMatch( objectFlags, inheritedObjectType );
                    if ( !commonInheritanceFlagsExist ) 
                    {
                        aceFlags &= ~AceFlags.InheritanceFlags;
                    }
                }
                else if (( objectFlags & ObjectAceFlags.InheritedObjectAceTypePresent ) != 0 ) 
                {
                    // the existing ace is a common ace and the one we're removing 
                    // refers to a specific child type so this is invalid
                    return false;
                }               
            }

            return true;

        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:55,代码来源:ACL.cs


示例20: ObjectTypesMatch

        //
        // This method checks if the objectType matches with the specified object type
        // (Either both do not have an object type or they have the same object type)
        //
        internal bool ObjectTypesMatch(ObjectAceFlags objectFlags, Guid objectType)
        {
            if ((ObjectAceFlags & ObjectAceFlags.ObjectAceTypePresent) != (objectFlags & ObjectAceFlags.ObjectAceTypePresent))
            {
                return false;
            }

            if (((ObjectAceFlags & ObjectAceFlags.ObjectAceTypePresent) != 0) &&
                (!ObjectAceType.Equals(objectType)))
            {
                return false;
            }

            return true;
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:19,代码来源:ACE.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ObjectArray类代码示例发布时间:2022-05-24
下一篇:
C# Object类代码示例发布时间: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